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 for multiple value for an option #60

Open
gogito opened this issue Oct 16, 2024 · 1 comment
Open

Support for multiple value for an option #60

gogito opened this issue Oct 16, 2024 · 1 comment

Comments

@gogito
Copy link

gogito commented Oct 16, 2024

Hi, the script is great already but it would be completed if it can support multiple value for an option when working would multiple input file for example:

myscript --file file1 file2 file3

Right now it doesn't seem like there is a way to do this if I'm understanding correctly.

@ko1nksm
Copy link
Owner

ko1nksm commented Oct 16, 2024

Hi

Its syntax cannot distinguish between the following two

myscript --file file1 file2 file3
myscript --name value file1 file2

There is no specification for multiple-valued options in either POSIX or GNU. If necessary, use the following alternative way.

myscript file1 file2 file3
myscript --file file1,file2,file3
myscript --file file1 --file file2 --file file3

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap12.html

Guideline 8:
When multiple option-arguments are specified to follow a single option, they should be presented as a single argument, using <comma> characters within that argument or characters within that argument to separate them.

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