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

Make fish_opt option optional #10459

Open
oyarsa opened this issue Apr 25, 2024 · 1 comment
Open

Make fish_opt option optional #10459

oyarsa opened this issue Apr 25, 2024 · 1 comment

Comments

@oyarsa
Copy link

oyarsa commented Apr 25, 2024

#7585 seems to have fixed only the string spec for argparse, but fish_opt still requires --short to be provided, even when we have --long-only:

String spec version:

# script.fish
argparse 'opt=' -- $argv
echo $_flag_opt

Output:

❯ fish script.fish --opt hi
hi

fish_opt version:

# script2.fish
set option (fish_opt --long=opt --long-only --required)
argparse $option -- $argv
echo $_flag_opt

Output:

❯ fish script2.fish --opt hi
fish_opt: The --short flag is required and must be a single character
argparse: --opt: unknown option

I expected fish_opt to have same capabilities as the string spec.

Fish version: 3.6.1

@faho
Copy link
Member

faho commented Apr 25, 2024

To be honest: Use argparse directly.

I don't think fish_opt is really all that helpful. Personally, I consider it a mistake and would prefer to remove it.

@faho faho added this to the fish-future milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants