fulldecent / corelocationcli

Command line program to print location information from CoreLocation
MIT License
217 stars 29 forks source link

Refactor command parameters #36

Closed jsejcksn closed 2 years ago

jsejcksn commented 3 years ago

There is an established convention for CLI parameters. Here are a few links you can read through to get a basic idea:

Parameters that are a single character should use a single hyphen - so that they can be used together if they don't require values.(e.g. command -abc)

Parameters that are multiple characters should use a double hyphen --. (e.g. CoreLocationCLI --json)

There are also established conventions for parameters like --help, which would be useful for anyone who discovers the program and wants to learn more.

So, you could alias the current mulit-character commands like this:

-h, --help
-v, --verbose

etc.


Here are some suggestions:

-h, --help
-f, --format
-j, --json
-v, --verbose
-V, --version (print version information)
-w, --watch (currently -follow)

f is already used by format, so I suggested -w, --watch. Another idea is -c, --continuous.

fulldecent commented 3 years ago

Looks great. That suggested set is good. Perhaps leave off -V.

Here is a library that may be able to do this https://github.com/apple/swift-argument-parser

fulldecent commented 2 years ago

Thank you, fixed and released