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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.

show_usage = 1;
break;
}
Expand All @@ -401,7 +401,7 @@ int main(int argc, char** argv) {
printf("-b BLKSIZEPOW Power over two of block size\n");
printf("-B TIMEOUT Block claim timeout\n");
printf("-n NEEDLESS_TIMEOUT Time until we release needless blocks\n");
printf("-s SPARELEASES Amount of spare leases (max: 256)\n");
printf("-s SPARELEASES Amount of spare leases (max: 255)\n");
printf("-L Deactivate learning phase\n");
printf("-d Run in background and daemonize\n");
printf("-D Run in foreground and log to console (default)\n");
Expand Down