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

Perfer flags to positional args #16

Closed
0xazure opened this Issue Nov 3, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@0xazure
Copy link
Owner

0xazure commented Nov 3, 2018

The current calling convention for supernova is:

supernova <username> [<auth-token>]

I was reading a really interesting article about 12 Factor CLI Apps that builds on Heroku's 12 Factor App methodology which suggests to "prefer flags to args":

Flags require a bit more typing, but make the CLI much clearer.
[...]
A good rule of thumb is 1 type of argument is fine, 2 types are very suspect, and 3 are never good.

We could introduce a dependency on clap to handle argument parsing, as well as to generate help docs and display version numbers.

@0xazure 0xazure self-assigned this Nov 3, 2018

0xazure added a commit that referenced this issue Nov 5, 2018

refactor: pass request token as a flag instead of an argument
Improves the calling convention to make the data passed more explicit
and help clarify usage. This also has the added benenfit of improving
discoverability as we can generate autocomplete help from the flag to
guide the correct usage.

The calling convention was:

`supernova <username> [<auth-token>]`

The calling convention is now:

`supernova <username> [--token <token>]`

Using clap also gives us help and version commands and display for free
in addition to argument parsing.

Closes #16.

0xazure added a commit that referenced this issue Nov 5, 2018

refactor: pass request token as a flag instead of an argument
Improves the calling convention to make the data passed more explicit
and help clarify usage. This also has the added benefit of improving
discoverability as we can generate autocomplete help from the flag to
guide the correct usage.

The calling convention was:

`supernova <username> [<auth-token>]`

The calling convention is now:

`supernova <username> [--token <token>]`

Using clap also gives us help and version commands and display for free
in addition to argument parsing.

Closes #16.

0xazure added a commit that referenced this issue Nov 5, 2018

refactor: pass request token as a flag instead of an argument
Improves the calling convention to make the data passed more explicit
and help clarify usage. This also has the added benefit of improving
discoverability as we can generate autocomplete help from the flag to
guide the correct usage.

The calling convention was:

`supernova <username> [<auth-token>]`

The calling convention is now:

`supernova <username> [--token <token>]`

Using clap also gives us help and version commands and display for free
in addition to argument parsing.

Closes #16.

0xazure added a commit that referenced this issue Nov 6, 2018

refactor: pass request token as a flag instead of an argument
Improves the calling convention to make the data passed more explicit
and help clarify usage. This also has the added benefit of improving
discoverability as we can generate autocomplete help from the flag to
guide the correct usage.

The calling convention was:

`supernova <username> [<auth-token>]`

The calling convention is now:

`supernova <username> [--token <token>]`

Using clap also gives us help and version commands and display for free
in addition to argument parsing.

Closes #16.

0xazure added a commit that referenced this issue Nov 11, 2018

refactor: pass request token as a flag instead of an argument
Improves the calling convention to make the data passed more explicit
and help clarify usage. This also has the added benefit of improving
discoverability as we can generate autocomplete help from the flag to
guide the correct usage.

The calling convention was:

`supernova <username> [<auth-token>]`

The calling convention is now:

`supernova <username> [--token <token>]`

Using clap also gives us help and version commands and display for free
in addition to argument parsing.

Closes #16.

@0xazure 0xazure closed this in #19 Nov 17, 2018

0xazure added a commit that referenced this issue Nov 17, 2018

refactor: pass request token as a flag instead of an argument
Improves the calling convention to make the data passed more explicit and help clarify usage. This also has the added benefit of improving discoverability as we can generate autocomplete help from the flag to guide the correct usage.

The calling convention was:

`supernova <username> [<auth-token>]`

The calling convention is now:

`supernova <username> [--token <token>]`

Using clap also gives us help and version commands and display for free in addition to argument parsing.

Closes #16.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.