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

feat: support skipping choice fn validation #105

Merged
merged 2 commits into from
May 18, 2023
Merged

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented May 18, 2023

Prepend ? to choices_fn to skip validate choice value

# @option --foo1[`_fn_foo`]
# @option --foo2[?`_fn_foo`]

_fn_foo() {
    echo a1
    echo a2
}

Run test.sh --foo1 aa

error: invalid value 'aa' for '<FOO1>'
  [possible values: a1, a2]

For more information, try '--help'.

Run test.sh --foo2 aa

argc_foo2=aa

@sigoden sigoden changed the title feat: support skipping choice validate feat: support skipping choice fn validation May 18, 2023
@sigoden sigoden merged commit 6452a5b into main May 18, 2023
@sigoden sigoden deleted the feat-skip-choices-validate branch May 19, 2023 03:13
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

Successfully merging this pull request may close these issues.

None yet

1 participant