mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Let the user know about their error
If the user informed wrong value, then let them know about that.
This commit is contained in:
parent
402e46bb82
commit
832e77c754
3
htop.c
3
htop.c
@ -112,6 +112,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
|
||||
flags.sortKey = ColumnsPanel_fieldNameToIndex(optarg);
|
||||
if (flags.sortKey == -1) {
|
||||
fprintf(stderr, "Error: invalid column \"%s\".\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
@ -120,11 +121,13 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
|
||||
if (flags.delay > 100) flags.delay = 100;
|
||||
} else {
|
||||
fprintf(stderr, "Error: invalid delay value \"%s\".\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
if (!Action_setUserOnly(optarg, &(flags.userId))) {
|
||||
fprintf(stderr, "Error: invalid user \"%s\".\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'C':
|
||||
|
Loading…
Reference in New Issue
Block a user