Add -j opt to filter output by JID#2
Merged
Freaky merged 1 commit intoFreaky:masterfrom Feb 25, 2020
zeylos:filter_jid
Merged
Conversation
Freaky
reviewed
Feb 25, 2020
Owner
Freaky
left a comment
There was a problem hiding this comment.
A couple of nits, nothing serious. Not like Github breaking repeatedly trying to submit this review :P
| } | ||
|
|
||
| while ((ch = getopt(argc, argv, "bHw")) != -1) { | ||
| while ((ch = getopt(argc, argv, "bHwj:")) != -1) { |
Owner
There was a problem hiding this comment.
Should be sorted alphabetically, so "bHj:w"
Owner
There was a problem hiding this comment.
(And sort the switch the same way)
| termwidth = 0; | ||
| break; | ||
| case 'j': | ||
| jid = atoi(optarg); |
Owner
There was a problem hiding this comment.
From atoi(3):
The atoi() function has been deprecated by strtol() and should not be used in new code.
There's a parse_int() function in checkrestart to make it easier to handle correctly, e.g:
if (!parse_int(optarg, &jid) || jid < 0) {
usage();
}
Owner
|
Will make tweaks myself. Thanks! |
Author
|
Ah my bad I didn't know atoi was deprecated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
As said in the title, I added the -j option to filter output by JID number.
I'm not a developer so my PR may be wrong (or even garbage), any criticism is welcomed.
Anyway thanks for the good work !