| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Client side of for Chrome Infra Package Deployer. | 5 // Client side of for Chrome Infra Package Deployer. |
| 6 // | 6 // |
| 7 // Subcommand starting with 'pkg-' are low level commands operating on package | 7 // Subcommand starting with 'pkg-' are low level commands operating on package |
| 8 // files on disk. | 8 // files on disk. |
| 9 package main | 9 package main |
| 10 | 10 |
| 11 import ( | 11 import ( |
| 12 cryptorand "crypto/rand" |
| 13 "encoding/binary" |
| 12 "encoding/json" | 14 "encoding/json" |
| 13 "flag" | 15 "flag" |
| 14 "fmt" | 16 "fmt" |
| 15 "io/ioutil" | 17 "io/ioutil" |
| 18 "math/rand" |
| 16 "net/http" | 19 "net/http" |
| 17 "os" | 20 "os" |
| 18 "path/filepath" | 21 "path/filepath" |
| 19 "strings" | 22 "strings" |
| 20 "sync" | 23 "sync" |
| 21 "time" | 24 "time" |
| 22 | 25 |
| 23 "github.com/maruel/subcommands" | 26 "github.com/maruel/subcommands" |
| 24 gol "github.com/op/go-logging" | 27 gol "github.com/op/go-logging" |
| 25 | 28 |
| (...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 newArgs := []string{} | 1667 newArgs := []string{} |
| 1665 if cmd != "" { | 1668 if cmd != "" { |
| 1666 newArgs = append(newArgs, cmd) | 1669 newArgs = append(newArgs, cmd) |
| 1667 } | 1670 } |
| 1668 newArgs = append(newArgs, flags...) | 1671 newArgs = append(newArgs, flags...) |
| 1669 newArgs = append(newArgs, positional...) | 1672 newArgs = append(newArgs, positional...) |
| 1670 return newArgs | 1673 return newArgs |
| 1671 } | 1674 } |
| 1672 | 1675 |
| 1673 func main() { | 1676 func main() { |
| 1677 var seed int64 |
| 1678 if err := binary.Read(cryptorand.Reader, binary.LittleEndian, &seed); er
r != nil { |
| 1679 panic(err) |
| 1680 } |
| 1681 rand.Seed(seed) |
| 1682 |
| 1674 os.Exit(subcommands.Run(application, fixFlagsPosition(os.Args[1:]))) | 1683 os.Exit(subcommands.Run(application, fixFlagsPosition(os.Args[1:]))) |
| 1675 } | 1684 } |
| OLD | NEW |