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

Support positional arguments #1

Closed
streamjoin opened this issue Apr 10, 2019 · 1 comment
Closed

Support positional arguments #1

streamjoin opened this issue Apr 10, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@streamjoin
Copy link
Owner

Need to provide a general approach to support positional arguments in bash scripts.

To achieve this, two key points need to do:

  1. Use || to concatenate all arg_set_opt_var entries with the tail to be arg_set_pos_var (TODO). To this end, we need arg_set_opt_var to return non-zero for no value assignment.

  2. In arg_set_pos_var, use one global variable __POS_ARG_CURSOR to count the positional index, and assign positional argument value to global variables POS_ARG_VAR_XX where XX is expanded from __POS_ARG_CURSOR.

@streamjoin streamjoin added the enhancement New feature or request label Apr 10, 2019
@streamjoin streamjoin self-assigned this Apr 10, 2019
@streamjoin
Copy link
Owner Author

Resolved in commit 0f9292d

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

No branches or pull requests

1 participant