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
fix color completition #2836
fix color completition #2836
Conversation
Thank you for your contribution! Please, as stated by the build server, write a line in doc/news/_preparation_next_release.md to make sure your contribution will be mentioned in the next release notes. Furthermore, there was a formatting problem (we use automatic code formatters) which is fixed in #2837. |
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.
Thank you for the pull request. I just added one code suggestion that might simplify the updated line. At least on my machine the simplified code seems to work too. Please feel free to ignore the suggestion, if you do not like it.
scripts/kdb-bash-completion
Outdated
@@ -23,7 +23,7 @@ _kdb() { | |||
# only kdb was entered yet, print a list of available commands | |||
if [[ $COMP_CWORD -eq 1 ]]; then | |||
local IFS=$'\n' | |||
local commands=($(${kdbpath} 2> /dev/null | sed -e '0,/^Known commands are/d' | awk '{print $1}')) | |||
local commands=($(${kdbpath} 2> /dev/null | sed -e '0,/^Known commands are/d' | awk '{print $1}' | sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" )) |
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 think you can use the kdb
subcommand list-commands
to simplify this code:
local commands=($(${kdbpath} 2> /dev/null | sed -e '0,/^Known commands are/d' | awk '{print $1}' | sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" )) | |
local commands=($(${kdbpath} list-commands)) |
.
using list-commands ElektraInitiative#2836
@sanssecours that's even better! |
Thank you for your contribution! We hope to see more from you soon! |
see #2835
Short release notes: Fix bash completion
Longer description: Now you can call kdb and it will return
Basics
Check relevant points but please do not remove entries.
Do not describe the purpose of this PR in the PR description but:
doc/news/_preparation_next_release.md
which contains_(my name)_
)Fix Please always add something to the the release notes.
(first line should have
module: short statement
syntax)close #X
, should be in the commit messages.Checklist
Check relevant points but please do not remove entries.
For docu fixes, spell checking, and similar none of these points below
need to be checked.
Review
Reviewers will usually check the following:
Labels
say that everything is ready to be merged.