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

Perform argbash arg parsing for bash functions #183

Open
DryHumorInDC opened this issue Jun 20, 2023 · 1 comment
Open

Perform argbash arg parsing for bash functions #183

DryHumorInDC opened this issue Jun 20, 2023 · 1 comment

Comments

@DryHumorInDC
Copy link

I love argbash for parsing arguments parse via an interactive shell. In addition, I would like to have this same functionality for user-defined functions.

@mbeko
Copy link

mbeko commented Oct 16, 2023

I also have a use case for this.

I often write simple tools or REST API clients as functions in a script. Whenever I need to use that functionality, I source the script and call the functions as needed. Some functions have many optional parameters, so using the positional argument variables for these gets quickly unwieldy, e.g. if you only want to set the last one of six optional parameters, you have to provide values for the other five.

Especially with multiplle small functions, it doesn't seem to make much sense to put each of them in a file, so I was wondering if it's feasible to add the Argbash functionality to functions.

However, I understand if this won't be added because even more code would be generated that bloats the script, or because it would be too much work to implement it properly such that there are no name conflicts.

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