Skip to content

Conversation

dbohdan
Copy link
Contributor

@dbohdan dbohdan commented Mar 18, 2025

It took me some time to realize AddArg with a string slice wasn't what I needed for multiple filename arguments and to find AddRest. This PR documents AddRest in the readme and adds a test for it.

@tdewolff tdewolff merged commit 6ce4f4f into tdewolff:master Mar 18, 2025
3 checks passed
@tdewolff
Copy link
Owner

Your work is highly appreciated, thanks for your PRs.

I would use the Rest instead of Arg+Rest when you'd be able to pass multiple input file names, but you can use it however you want.

@dbohdan
Copy link
Contributor Author

dbohdan commented Mar 18, 2025

Your work is highly appreciated, thanks for your PRs.

You're welcome!

I agree with your suggestion. What I use in my new program with argp is Rest and a length check to ensure at least one argument. The use of both AddArg and AddRest is to demonstrate them in the same example.

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.

2 participants