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
Filter tasks with in bash tab-complete sample #46
Conversation
The .bashrc example could tab-complete long task names if we filter out tasks using the current arg.
src/tasks.adoc
Outdated
@@ -266,7 +266,7 @@ Add this to your `.bashrc` to get tab-complete feature on bash. | |||
[source,bash] | |||
---- | |||
_bb_tasks() { | |||
COMPREPLY+=(`bb tasks |tail -n +3 |cut -f1 -d ' '`) | |||
COMPREPLY=( $(compgen -W "$(bb-util tasks |tail -n +3 |cut -f1 -d ' ')" -- ${COMP_WORDS[COMP_CWORD]}) ); |
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.
what is bb-util?
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.
oops :)
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.
bb-util is a wrapper script (for running bb.edns in other directories). Sorry about that.
My bash is not so good. Can you explain in lay man terms what this change means and how the behavior changes? |
In the new version, if you have 3 tasks (
but then if you type
and if you type So that |
I think |
In a sense, I guess this is letting bash filter the set of tasks based on what you've partially typed and if you've typed enough to just auto-complete the word, then it completes the typing for you. |
Neat! I'll try it locally. |
Another option could be to pass |
The .bashrc example could tab-complete task names if we filter
tasks using the current arg.