darcs

Patch 1533 bash_completion: better support for multi-level commands

Title bash_completion: better support for multi-level commands
Superseder Nosy List gpiero
Related Issues
Status accepted Assigned To
Milestone

Created on 2017-03-09.09:24:11 by gpiero, last changed 2017-03-20.04:31:56 by ganesh.

Files
File name Status Uploaded Type Edit Remove
bash_completion_-better-support-for-multi_level-commands.dpatch gpiero, 2017-03-09.09:24:11 application/x-darcs-patch
bash_completion_-copy-the-approach-used-by-the-zsh-completion.dpatch gpiero, 2017-03-15.19:27:20 text/plain
patch-preview.txt gpiero, 2017-03-09.09:24:11 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg19357 (view) Author: gpiero Date: 2017-03-09.09:24:11
This should give more appropriate results when completing multi-level
commands. It's a bit of a hack but should be good enough most of the times.

I.e., currently:

$ darcs show repo <TAB>
--help        contents      files         patch-index   repo
authors       dependencies  index         pristine      tags

with this completion:

$ darcs show repo <TAB>
--debug               --no-posthook         --run-posthook
--debug-http          --no-prehook          --run-prehook
--disable             --posthook            --standard-verbosity
--files               --prehook             --timings
--help                --prompt-posthook     --verbose
--list-options        --prompt-prehook      --xml-output
--no-cache            --quiet
--no-files            --repodir

Also supports 'help' and 'setpref' once (if) issue2525 is solved.

1 patch for repository valentina:var/repos/darcs/screened:

patch dd660f6b34d4e4775db2984c55f1a5568a482adc
Author: Gian Piero Carrubba <gpiero@rm-rf.it>
Date:   Thu Mar  9 12:04:53 CET 2017
  * bash_completion: better support for multi-level commands
Attachments
msg19367 (view) Author: bfrk Date: 2017-03-15.16:55:52
Thanks, applied (just to screened, for the moment, as I am not good at
reading much less understanding bash completion...).
msg19374 (view) Author: gpiero Date: 2017-03-15.19:27:20
* [Wed, Mar 15, 2017 at 04:55:53PM +0000] Ben Franksen:
>Thanks, applied (just to screened, for the moment, as I am not good at
>reading much less understanding bash completion...).

Oops, was going to send an amended patch that copied the approach used 
by the zsh completion as it is much cleaner. Attaching a new patch that 
cleanly apply to current screened, instead.

Best,
Gian Piero.
Attachments
msg19375 (view) Author: bfrk Date: 2017-03-16.05:47:56
No problem. The simplification is appreciated ;-)

(I am a bit surprised that this works, I thought zsh and bash were
completely different here.)
msg19381 (view) Author: ganesh Date: 2017-03-20.04:31:56
Looks good to me (I've read it and tried it out), thanks!
History
Date User Action Args
2017-03-09 09:24:11gpierocreate
2017-03-15 16:55:53bfrksetmessages: + msg19367
2017-03-15 16:56:01bfrksetstatus: needs-screening -> needs-review
2017-03-15 19:27:20gpierosetfiles: + bash_completion_-copy-the-approach-used-by-the-zsh-completion.dpatch
messages: + msg19374
2017-03-16 05:47:56bfrksetmessages: + msg19375
2017-03-20 04:31:56ganeshsetstatus: needs-review -> accepted
messages: + msg19381