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

Feature Request: GIT style commands with arguments #184

Open
myramoki opened this issue Nov 16, 2023 · 1 comment
Open

Feature Request: GIT style commands with arguments #184

myramoki opened this issue Nov 16, 2023 · 1 comment

Comments

@myramoki
Copy link

I would really like to be able to use Argbash to create a GIT style argument processing. This would allow for a couple different items.

  1. Define arguments to parse at the global level
  2. Define multiple commands like GIT has
  3. Define arguments associated with specific commands.

Processing would allow a script with the following form:

script-name [ global-arguments... ] cmd-name [ cmd-specific-args... ]

Then I could use it to create scripts where I could call it like:

prodadm -debug install -name games

I was envisioning a configuration syntax of new ARG_CMD... options, which associate the argument processing with a specific command, and allow the same argument name to be used in different ways for different commands.

# ARG_CMD([cmd], [optional short form], [optional command help msg])
# ARG_CMD_OPTIONAL_SINGLE([cmd], [option], [o], [optional argument help msg])
# ARG_CMD_OPTIONAL_BOOLEAN([cmd], [print], , [boolean optional argument help msg])
# ARG_CMD_POSITIONAL_SINGLE([cmd], [positional-arg], [positional argument help  msg], )
# ARG_CMD_HELP([cmd], [The general script's help msg])
@zhando
Copy link

zhando commented Nov 30, 2023

Otherwise known as command subcommand.. Yes I was looking for this too. I don't believe it's easy to do with argbash at the moment. Off the top of my head, perhaps one can pass all arguments through to all the functions and the functions can just ignore what doesn't apply. Doesn't seem too elegant.

First time here and it seems development has halted on argbash. Too bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants