-
Notifications
You must be signed in to change notification settings - Fork 232
[WIP] Topic/completion #19
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
Conversation
|
|
||
| case "$prev" in | ||
| -p) | ||
| COMPREPLY=( $( compgen -W "$(labgrid-client complete places)" -- $cur ) ) |
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.
maybe cache the list in a global variable and only rerun the command if COMPREPLY is empty?
| release\ | ||
| env\ | ||
| power\ | ||
| console" -- $cur ) ) |
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.
This list should be generated. Either from parsing labgrid-client -h or new new labgrid-client complete commands. Otherwise this is always out of date. Just cache the list in a global variable to speed things up.
| # completing an option | ||
| if [[ "$cur" == -* ]]; then | ||
| COMPREPLY=( $( compgen -W "-p -h -x" -- $cur ) ) | ||
| else |
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.
No need to split things up here. compgen will filter thing correctly depending on $cur.
86f45d4 to
f94fdd4
Compare
1 similar comment
65e5c34 to
1112993
Compare
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Add filter support to complete command: -m, --mine places/resources acquired by the local client -a, --acquired places/resources acquired by all clients
1112993 to
bb2a8f1
Compare
Codecov Report
@@ Coverage Diff @@
## master #19 +/- ##
========================================
- Coverage 56.5% 56.4% -0.2%
========================================
Files 77 77
Lines 3440 3450 +10
========================================
+ Hits 1947 1949 +2
- Misses 1493 1501 +8
Continue to review full report at Codecov.
|
|
Closing this for now. |
|
Oh, why was this abandoned? I think shell completion for labgrid-client would be a great feature. |
TODO: