The bash completion of 'bkr' lists '--password' as an option, bash completion of 'bkr --password' lists the following [rmancy@rmancy ~]$ bkr --password -- --help --help] --password --username Notice the '--help]'. Also, none of these completions actually render a sensible command. The below Comment is from Filip Holec on how to fix it(thanks!): This should fix it: <local opts=$(echo $( bkr $component --help 2>/dev/null | grep -o -- '--[^ =]*' | sort | uniq ) --help ) >local opts=$(echo $( bkr $component --help 2>/dev/null | grep -v "Usage:" | grep -o -- '--[^ =]*' | sort | uniq ) --help )
reproduced on beaker-devel Version - 0.13.2 bkr client on Fedora 17 Actual results: $bkr --password --<tab> --help --help] --hub --password --username
The other problem is with aliased options, for example: $ bkr workflow-simple --no --nowait --no-wait, The fix is probably the same. Another possible fix to consider is switching to: http://furius.ca/optcomplete/ which might also improve the very sluggish completion speed.
The completion for files in "brk job-submit" doesn't work either. Example: $ touch foo.xml $ bkr job-submit fo<TAB> ....gives nothing. Should I open new bug report?
(In reply to Otto Sabart from comment #4) Thanks Otto, no need for a separate bug at this point, we can cover it here.
Lately I have been tempted by Armin Ronacher's Click library for CLIs [1] to replace the stuff we inherited from Kobo. Handily it has support for generating bash completion [2] although it is apparently not customizable and looks like it is not smart enough to be able to complete filenames for positional arguments when appropriate... [1] http://click.pocoo.org/ [2] http://click.pocoo.org/3/bashcomplete/
The move to Click has fallen by the wayside a little, but I have posted a patch to deal with the simplest problems above. http://gerrit.beaker-project.org/4006 This bug will stay open for now since that patch doesn't address all the problems identified here.
This commit: https://github.com/beaker-project/beaker/commit/8f6fd28cd454a5bda9907fe9f763c9f9475394bf Seems to solve the remaining issues mentioned in this bug. So once the current develop branch gets pushed to master, I would think this bug can be closed. The original bug is already fixed. Comment 4 issue: Is fixed with the mentioned commit. Comment 2 issue: Is fixed with the mentioned commit. Doing "bkr workflow-simple --no<TAB>" only produces "--no-wait"
*** This bug has been marked as a duplicate of bug 1776324 ***