Skip to content

Commit

Permalink
fix(cli): add options placement to usage, reorder flags to match outp…
Browse files Browse the repository at this point in the history
…ut (#24)
  • Loading branch information
osm0sis authored Dec 7, 2021
1 parent 412e5a9 commit 4d05a47
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ func main() {
concurrency int
)

flag.BoolVar(&list, "list", false, "Show list of partitions in payload.bin")
flag.IntVar(&concurrency, "c", 4, "Number of multiple workers to extract (shorthand)")
flag.IntVar(&concurrency, "concurrency", 4, "Number of multiple workers to extract")
flag.BoolVar(&list, "l", false, "Show list of partitions in payload.bin (shorthand)")
flag.StringVar(&partitions, "partitions", "", "Dump only selected partitions (comma-separated)")
flag.StringVar(&partitions, "p", "", "Dump only selected partitions (comma-separated) (shorthand)")
flag.StringVar(&outputDirectory, "output", "", "Set output directory")
flag.BoolVar(&list, "list", false, "Show list of partitions in payload.bin")
flag.StringVar(&outputDirectory, "o", "", "Set output directory (shorthand)")
flag.IntVar(&concurrency, "concurrency", 4, "Number of multiple workers to extract")
flag.IntVar(&concurrency, "c", 4, "Number of multiple workers to extract (shorthand)")
flag.StringVar(&outputDirectory, "output", "", "Set output directory")
flag.StringVar(&partitions, "p", "", "Dump only selected partitions (comma-separated) (shorthand)")
flag.StringVar(&partitions, "partitions", "", "Dump only selected partitions (comma-separated)")
flag.Parse()

if flag.NArg() == 0 {
Expand Down Expand Up @@ -123,7 +123,7 @@ func main() {
}

func usage() {
fmt.Fprintf(os.Stderr, "Usage: %s [inputfile]\n", os.Args[0])
fmt.Fprintf(os.Stderr, "Usage: %s [options] [inputfile]\n", os.Args[0])
flag.PrintDefaults()
os.Exit(2)
}

0 comments on commit 4d05a47

Please sign in to comment.