-
Notifications
You must be signed in to change notification settings - Fork 86
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
bash completions #563
bash completions #563
Conversation
Let -s source behave as if it replaces the default group source, and thus omit the source prefix for the groups in that source. Part of cea-hpc#563.
Let -s source behave as if it replaces the default group source, and thus omit the source prefix for the groups in that source. Part of #563.
Hi @martinetd and thanks for this! I would like to include clush bash completion is 1.9.3 if possible, so I've been looking at this today. But I think we might be able to come up with something to only call The idea would be as follow:
This gives us this on our cluster:
Here I got this result from this: -w|-x)
if [[ -n "$groupsource" ]]; then
options="$(cluset -s "$groupsource" -l -G 2>/dev/null)"
else
options="$(cluset --groupsources | sed -e 's/ (default)//' -e 's/^/@/' -e 's/$/:/')"
options+="$(cluset -l 2>/dev/null)"
fi
;; However, I'm not sure how to trigger a group lookup when we do |
Special command for bash completion that lists group sources, groups in current source and nodes from groups passed as argument: cluset --completion [-s source] [groups] Example: cluset --completion $*
276550c
to
2f273dc
Compare
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 investigating a unexpected blank result in some cases
Special command for bash completion that lists group sources, groups in current source and nodes from groups passed as argument: cluset --completion [-s source] [groups] Example: cluset --completion $* Part of cea-hpc#563.
Provide bash completion scripts for clush and cluset/nodeset to autocomplete group sources, groups and "all" nodes from the default or selected source. Part of cea-hpc#563.
Special command for bash completion that lists group sources, groups in current source and nodes from groups passed as argument: cluset --completion [-s source] [groups] Example: cluset --completion @* Part of cea-hpc#563.
Provide bash completion scripts for clush and cluset/nodeset to autocomplete group sources, groups and "all" nodes from the default or selected source. Part of cea-hpc#563.
Because it conflicts with xCAT's nodeset command. Part of cea-hpc#563.
Because it conflicts with xCAT's nodeset command. Part of cea-hpc#563.
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.
Overall, this is a very nice work! I'm just not convinced by the missing completion for nodeset
Provide bash completion scripts for clush and cluset/nodeset to autocomplete group sources, groups and "all" nodes from the default or selected source. Part of cea-hpc#563.
Just clush for now; might be some bugs but seems to work.
perf-wise it calls
cluset -L
on every tab, we might need to cache the result somewhere if it is slow in some setups.(But if user changes conf files it won't be reloaded so that's a bit annoying, it's better not to cache if it's reasonable e.g. just reading the conf files)
Prereq patch makes
cluset -s foo -L
not listfoo
groups with the@foo:
prefix, like default source with-L
-- this allowsclush -s foo -w @bar
to complete properly.