Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): add options placement to usage, reorder flags to match output #24

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}