Merge lp:~bcsaller/pyjuju/bash-completion into lp:pyjuju
Proposed by
Dustin Kirkland
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Kapil Thangavelu | ||||
Approved revision: | 257 | ||||
Merged at revision: | 282 | ||||
Proposed branch: | lp:~bcsaller/pyjuju/bash-completion | ||||
Merge into: | lp:pyjuju | ||||
Diff against target: |
113 lines (+102/-0) 2 files modified
debian/install (+1/-0) misc/bash_completion.d/ensemble (+101/-0) |
||||
To merge this branch: | bzr merge lp:~bcsaller/pyjuju/bash-completion | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
dann frazier (community) | Approve | ||
Gustavo Niemeyer | Approve | ||
Review via email: mp+68124@code.launchpad.net |
Description of the change
I had a similar but different implementation of bash completion for Ensemble in lp:~kirkland/ensemble/bash-completion.
I'm deferring my branch in favor of Ben's, which is a bit better about supporting positional arguments. I have tested Ben's code and it works well for me. Could we get this merged into trunk so that Ensemble users can benefit from bash tab completion?
Thanks,
Dustin
To post a comment you must log in.
I'm not familiar with that shell syntax, so might be nice to have a second review
from someone that actually does. Here are a few points:
[1]
=== added directory 'etc'
Can we please name this as "misc" to avoid binding the content to /etc?
[2]
+ if [[ $cur != -* ]] && [[ $COMP_CWORD -gt 1 ]]; then
Isn't the normal form [[ A -a B ]] instead of [[ A ]] && [[ B ]] ?
[3]
+ globalOpts=( -h --verbose -v --log-file)
(...)
+ cmdOpts=( --environment --repository )
(...)
+ cmdOpts=( --dry-run -n --environment --repository)
(...)
+ cmdOpts=(--help -h)
Spacing is very uneven. All of these entries should either
have a space on both ends, or in none.
[4]
82 + status)
83 + cmdOpts=( --output --format --environment)
84 + case $curOpt in
85 + --format) optEnums=( json yaml png svg dot )
86 + esac
87 + ;;
88 + upgrade-formula)
89 + cmdOpts=( --dry-run -n --environment --repository)
90 + ;;
91 + *)
92 + cmdOpts=(--help -h)
93 + ;;
Indentation seems broken, probably due to the mix of spaces and tabs. Tabs are probably
better as they allow the reader to choose, but they should be taken as 8 spaces in that
case. 4-space tabs are likely going to break most people's expectations (and they break
Launchpad's.. see the diff below).
[5]
84 + case $curOpt in
85 + --format) optEnums=( json yaml png svg dot )
86 + esac
case is unclosed (;;).