Chromium Code Reviews| 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 "encoding/json" | 12 "encoding/json" |
| 13 "flag" | 13 "flag" |
| 14 "fmt" | 14 "fmt" |
| 15 "io/ioutil" | 15 "io/ioutil" |
| 16 "math/rand" | |
| 16 "net/http" | 17 "net/http" |
| 17 "os" | 18 "os" |
| 18 "path/filepath" | 19 "path/filepath" |
| 19 "strings" | 20 "strings" |
| 20 "sync" | 21 "sync" |
| 21 "time" | 22 "time" |
| 22 | 23 |
| 23 "github.com/maruel/subcommands" | 24 "github.com/maruel/subcommands" |
| 24 gol "github.com/op/go-logging" | 25 gol "github.com/op/go-logging" |
| 25 | 26 |
| (...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1664 newArgs := []string{} | 1665 newArgs := []string{} |
| 1665 if cmd != "" { | 1666 if cmd != "" { |
| 1666 newArgs = append(newArgs, cmd) | 1667 newArgs = append(newArgs, cmd) |
| 1667 } | 1668 } |
| 1668 newArgs = append(newArgs, flags...) | 1669 newArgs = append(newArgs, flags...) |
| 1669 newArgs = append(newArgs, positional...) | 1670 newArgs = append(newArgs, positional...) |
| 1670 return newArgs | 1671 return newArgs |
| 1671 } | 1672 } |
| 1672 | 1673 |
| 1673 func main() { | 1674 func main() { |
| 1675 rand.Seed(time.Now().Unix()) | |
|
Vadim Sh.
2016/04/11 16:52:03
I was bit in the ass by this construct. Multiple p
nodir
2016/04/11 22:16:16
Done.
| |
| 1674 os.Exit(subcommands.Run(application, fixFlagsPosition(os.Args[1:]))) | 1676 os.Exit(subcommands.Run(application, fixFlagsPosition(os.Args[1:]))) |
| 1675 } | 1677 } |
| OLD | NEW |