-
Notifications
You must be signed in to change notification settings - Fork 41
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
{ls,ins,rm}mod: update help, man and {bash,fish,zsh} shell completion #138
Conversation
a27f71b
to
dba5502
Compare
Switching to draft since there are some small bugs and cleanups needed. Would love to hear on the fiddly bits mentioned above and generally if this is something we'd want before polishing it. |
agree
agree |
yes... this all looks good to me. Thanks |
dba5502
to
d98f3a9
Compare
Glad to hear - series re-spinned. Will look at the rest (modinfo, modprobe, depmod) at a later date. |
Add a trivial helper that prints the version + features combo. I will be adding another instance of those, so I'm aiming to keep the boilerplate code to a minimum. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
This allows for more consistent experience across tools, allows to see the version, observe/debug if "Used by" reports -1, etc. Also don't forget to update the man page :-) Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
The (long)option and handling was removed some 10 years ago, yet the shortopt remained... oops Fixes: a4bd144 ("Remove "rmmod -w" documentation and getopt entry") Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
Drop the kernel configuration details - the CONFIG toggle name is more useful (since you can see it in /proc/config.*) and generally the part is better suited for the manual page. Move DANGEROUS at the front, so it's obvious from the start Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
Stay consistent with the output of rmmod --help and update the respective options. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
They're used locally within one function so declare them there. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
Currently we'll print "Module foo is in use by:" to syslog, while the modules themselves will end up in strerr. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
In the unlikely case where kmod_module_new_from_{path,name} fails, rmmod will return success. Change that to EXIT_FAILURE. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
These have been around since the import to git, doing nothing. There are no users that I can see, the manual page does not list them and the shell completions (fish and bash lack any for insmod, zsh has one) don't suggest it either. Remove them. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
Add the extra options for consistency with the rest of kmod. Document all options in the man page. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
As of the initial import to git, the option was silently ignored. Shortly afterwards, functionality was reinstated lacking a longopt and any documentation. As per insmod(8) for most use-cases you'd want to use modprobe(8). Although since the option is available and we have an equivalent in rmmod(8) having it documented and consistent triumphs. Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
I pushed up the patches that add shell completion. I think we also need to integrate with autotools before merging the rest. |
d98f3a9
to
f232ec5
Compare
Note that completions are explicitly aimed to be simple, depending on as little as possible shell specific helpers. The goal is that people unfamiliar with these can extend them with zero ramp-up. Doing things efficiently or "properly" is somewhat secondary. v2: - wire the completions to the autotools build v3: - use SPDX style copyright statements Signed-off-by: Emil Velikov <[email protected]>
v2: - use e(x)clusive answers for fish, tweak force string v3: - wire the completions to the autotools build v4: - use SPDX style copyright statements Signed-off-by: Emil Velikov <[email protected]>
A few inline todos and some odd fish behaviour as mentioned inline. Otherwise things just work :-) v2: - use e(x)clusive answers for fish, tweak force string v3: - wire the completions to the autotools build v4: - use SPDX style copyright statements Signed-off-by: Emil Velikov <[email protected]>
f232ec5
to
e2d1c0e
Compare
Note that completions are explicitly aimed to be simple, depending on as little as possible shell specific helpers. The goal is that people unfamiliar with these can extend them with zero ramp-up. Doing things efficiently or "properly" is somewhat secondary. v2: - wire the completions to the autotools build v3: - use SPDX style copyright statements Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
v2: - use e(x)clusive answers for fish, tweak force string v3: - wire the completions to the autotools build v4: - use SPDX style copyright statements Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
A few inline todos and some odd fish behaviour as mentioned inline. Otherwise things just work :-) v2: - use e(x)clusive answers for fish, tweak force string v3: - wire the completions to the autotools build v4: - use SPDX style copyright statements Signed-off-by: Emil Velikov <[email protected]> Link: #138 Signed-off-by: Lucas De Marchi <[email protected]>
Applied, thanks. |
As the title says, this series focuses on lsmod/rmmod/insmod.
In general, we've ensured they're consistent among other another - syslog/verbose/version/help for all - aligning the help and manual pages.
Some potentially picky bits:
rmmod
-p
and-s
insmod
-f
Input welcome: