-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: implement kill -l
#221
Conversation
Performance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
Thanks for taking a look at Had you noticed the implementation of (One note -- right now the |
Cool thanks! I will look at that |
@reubeno I have questions
while
|
Yes, I think it would be best for
I see the inconsistencies as well; I'm assuming some of it maybe intentional, and other aspects may come down to the way the shared code happened to be structured. For
I see bash$ kill -l int
2
bash$ kill -l iNt
2
bash$ kill -l INT
2
bash$ kill -l SiGiNT
2
bash$ kill -l SIGINT
2
bash$ kill -l sigint
2
I think it makes sense to mimic the bash behavior for |
0407a0a
to
827abca
Compare
|
@reubeno Should I try to use |
|
|
5e66425
to
9812c48
Compare
What would your recommendation be? I think the requirements here are that the numbers for these virtual signals don't conflict with any of the real signals. They're not expected to be portable across systems, to my knowledge. |
Fоr now, I made it without numbers. It is pretty accurate,
in |
Sounds good to me. I'll try to review this in the next day or so. (I'd gotten a bit busy looking at an incoming issue report that seemed more severe (syntax parse failures).) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes generally look good to me; just a few comments related to testing. Thanks for putting in the work to get trap
and kill
to agree on things. I think that will pay off over time.
kill -l 5 | ||
kill -l 6 | ||
kill -l 7 | ||
kill -l 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was kill -l 8
intentionally omitted? For that matter, what about going with a for
loop for better maintainability/readability?
cases: | ||
- name: "kill -l" | ||
ignore_stderr: true | ||
# note that we dont use 'kill -l' because of the shape of the bash list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other ideas on how to get some test coverage for kill -l
?
I'm not sure how much we want to assume about the format of bash
's output, but something like this would extract a "flat" list from its implementation of kill -l
:
siglist=($(kill -l | sed -e "s/[[:digit:]]\+)//g"))
for s in ${siglist[@]}; do echo $s; done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reubeno should we also hide EXIT from the printed list? The test is currently failing because of EXIT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong preference on that. If we want to allow it to be different, we can always intentionally have the test grep -v
/ exclude it so it doesn't show up in a delta.
There should be additional signals for linux that are not listed in nix::Signal... |
There is ongoing pr for realtime signals in nix nix-rust/nix#2451 |
Is that something we could integrate with later (without preventing us from moving forward with this set of changes now)? |
Yeah. For now just realtime signals are missing (the linux failed test shows them) |
Sounds like something we could track with a TODO follow-up and exclude from the diff (via grep) for now? |
Your latest changes are looking good to me. Please let us know when you're ready for final review before merging? |
@reubeno I'm ready |
Utilize
nix::signal::Signal
to print the all signals.Note that
0 - EXIT
is missing for now because it is not posix, and I didn't find any documentation for theEXIT
signal, except for thetrap
builtin https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html