-
Notifications
You must be signed in to change notification settings - Fork 52
Add Bash completion #396
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
base: master
Are you sure you want to change the base?
Add Bash completion #396
Conversation
There doesn't seem to be an existing directory The installation should be performed automatically within a process instructed in Install, such as |
CPAN distributions are operating system agnostic. |
Thank you for your help, @akinomyoga . I also changed mech-dump so that the command line options will always match with the current options. |
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.
CPAN distributions are operating system agnostic. There is no defined way to install anything which does not install into a Perl installation tree. The operating system packaging teams would deal with the issue, e.g. DebianPerlGroup.
Thank you for explaining the special situation with the CPAN distributions. OK, I'm not familiar with Perl installations anyway.
For instance, I haven't used any of the convenient functions provided by [bash-completion}(https://github.com/scop/bash-completion/blob/main/bash_completion).
_init_completion
is a utility function provided by scop/bash-completion
, though it doesn't seem to be used in the current version. See also the following code-change suggestion.
I also changed mech-dump so that the command line options will always match with the current options.
Thank you for updating the completion. This is the ideal approach.
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.
Also, it is better to use only letters, numbers, and underscores in function names.
I have opened discussion with Debian Perl Group. I have been in contact before. We could ask other platform packagers but I do not know how to reach others. |
Suppress: * SC2207, Prefer mapfile or read -a to split command output (or quote to avoid splitting). * SC2016, Expressions don't expand in single quotes, use double quotes for that.
51d4ebc
to
40d841c
Compare
|
The completion scripts are sometimes done by others, the users of the software, not the developers. So |
I wonder if @michal-josef-spacek has an opinion? |
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.
Pull Request Overview
This PR adds Bash completion support for the mech-dump
command-line tool. The implementation generates completion options dynamically by parsing the command-line options defined in the script.
- Added a Bash completion script that uses
mech-dump --completions
to generate completion options - Enhanced the
mech-dump
script to support a--completions
flag that outputs available command-line options - Included documentation for installing the Bash completion script
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
share/bash-completion/completions/mech-dump | New Bash completion script that integrates with the completion system |
share/README.md | Documentation for installing the completion script |
script/mech-dump | Added --completions option and refactored option parsing to enable dynamic completion generation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There are 4 Perl packages in Fedora:
|
Thank you. |
Issue #317