-
Notifications
You must be signed in to change notification settings - Fork 79
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
Introduce add
subcommand per fetcher type
#35
Conversation
Nice, thanks! Why not have a flag instead? e.g. $ niv add --github ...
$ niv add --docker ... I understand that in that case the help message may become a bit long but at least you can still write $ niv add nmattia/niv which I think is invaluable. Or maybe we can have an optional subcommand? is that possible with optparse? |
I dont' think we could have a nice help menu with flags since they are not really suitable to group arguments. What about trying to create a special
However, I don't know if it is possible with the lib :/ |
I gave this a try, I think there are a few solutions: bdd3e98 Let's pair and see what we can come up with! |
add
subcommand per fetcher typeadd
subcommand per fetcher type
25fc4c9
to
98ba9e7
Compare
add
subcommand per fetcher typeadd
subcommand per fetcher type
This commit introduces subcommand to the `add` command. These subcommands permit to specify a fetcher type in order to be able to specify options per fetcher type. For instance, the `--branch` option is useless for the `file` fetcher. Thanks to this commit, the `--branch` option is only displayed in the help of the `niv add github` command. Some usage examples: niv add github stedolan/jq niv add github NixOS/nixpkgs-channels -n nixpkgs -b nixos-18.09 niv add file my-package -v alpha-0.1 -t http://example.com/archive/<version>.zip
This commit also improves parsing of several options: `type`, `url-template` options can no longer be repeated.
Closing, handled in #151 |
This commit introduces subcommand to the
add
command. Thesesubcommands permit to specify a fetcher type in order to be able to
specify options per fetcher type. For instance, the
--branch
option isuseless for the
file
fetcher. Thanks to this commit, the--branch
option is only displayed in the help of the
niv add github
command.Some usage examples:
TODO: