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

Fix diagnostic output #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stoeckmann
Copy link

Also give more information in case of invalid command line arguments.
Fix help message.

stoeckmann added 2 commits May 3, 2023 20:23
If an unknown command line argument is given, at least show which
index is affected.

Signed-off-by: Tobias Stoeckmann <[email protected]>
The maximum spare leases are 255, not 256.
This limit is due to the underlying type used.

Signed-off-by: Tobias Stoeckmann <[email protected]>
@@ -382,7 +382,7 @@ int main(int argc, char** argv) {
break;

default:
printf("ARGC: %i\n", argc);
printf("Unknown argument at index %i\n", optind);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we print the unrecognized argument string instead?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a quick discussion about this in our review and without further investigation into the workings of getopt here, this was the least intrusive patch we could find. We can take another look at this to see if the needed string is readily available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argv[optind] should work.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were unsure re this, because of folding of short options.

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.

3 participants