-
Notifications
You must be signed in to change notification settings - Fork 86
Add no-arg options -b and -B to bash_completion.d/clush #598
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
Open
OleHolmNielsen
wants to merge
2
commits into
cea-hpc:master
Choose a base branch
from
OleHolmNielsen:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
(nitpick) if we're going to add this might as well add other no-arg options from help:
-G|--groupbase|-L|-N|-P|--progress|-b|--dshbak|-B|-r|--regroup|-S|--maxrc|--diff|-p(other standalone options such as
--color=*are caught in the--*=*later; I'm honestly not sure why I stopped at debug...)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.
Hi Dominique,
Thanks a lot for considering this patch!
I tested it successfully on AlmaLinux 8.10 (Bash 4.4.20) and RockyLinux 9.7 (Bash 5.1.8) by manually adding
-b|-Bto/usr/share/bash-completion/completions/clushas installed by the RPM:I have no idea why the Github checks are failing my simple patch?
Actually, I mostly use the
-boption together with-g <group>like in this example:Would it be possible to have also
-bg <group>as a permitted command completion? That would be convenient, although only optional and not necessary.Thanks a lot, and Happy New Year,
Ole
Uh oh!
There was an error while loading. Please reload this page.
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 mean yes
clush -b -g ...works with this patch, but for me it also works without, so I was a bit lost :)(FWIW you can try this without installing by just sourcing the completion script, bash will not overwrite anything you sourced manually)
Hmm, right,
-b -gworks,-bgdoesn't right now -- the code does handle-ggroupwithout space, but there's nothing handling any non-argument letters earlier...This makes the script even harder to understand, but this seems to mostly work from quick testing:
I'm.. honestly not convinced we want to go that far (at this point we're really reimplementing the parsing in bash...), but I don't think it'd break anything, and part of the above (with full_cur) is actually a fix needed for
-w@source:...anyway, so I guess if you're fine with it I can clean this up in a few commits and push to your branch (if I can) or open a new PR...yeah, I had a quick look and the parent commit passes so I don't know either, this is unrelated so just ignore and @thiell will get around to it eventually :)
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.
Thanks, I removed my patch manually and did:
When I reintroduce my patch it works as expected again:
This is RockyLinux 9.7 (Bash 5.1.8).
Let's ignore my
-bgsuggestion since we don't want to introduce complexity.Thanks,
Ole
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 really don't understand why it wouldn't work as is -- what doesn't work is that
clush -b -g alma9 commandwon't properly complete the command, but thealma9bit should complete (and this works on bash-5.3.0-2.fc43.x86_64 / bash-completion-2.16-2.fc43.noarch)...Anyway, as said in the first place, it is the correct thing to do -- please just add all of
-G|--groupbase|-L|-N|-P|--progress|-b|--dshbak|-B|-r|--regroup|-S|--maxrc|--diff|-pand not just-b|-B-- the diff I wrote above has it if you have trouble with line continuations.As far as I'm concerned this PR can get in with just that fixed (and we can worry about complexity and
-bgnext year.. :))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.
Thanks a lot! FC43 is way ahead of Rocky/Alma/RHEL 9 in many ways, so maybe this is why it works for you?
Or maybe my problem is that we have upgraded ClusterShell during many releases (always from the EPEL repo) so that some old configs are causing problems - I don't know.
So I'll add your suggested configs, and look forward to a future release of your excellent tool. It's much appreciated!
Ole