From 9040359f6c7d05b17b796c4cf64939d340e19029 Mon Sep 17 00:00:00 2001 From: "William A. O. Brown" Date: Thu, 25 Oct 2018 21:37:35 +0100 Subject: [PATCH 1/2] Add Lerna completion options --- completion/available/lerna.completion.bash | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 completion/available/lerna.completion.bash diff --git a/completion/available/lerna.completion.bash b/completion/available/lerna.completion.bash new file mode 100644 index 00000000..f8439d3e --- /dev/null +++ b/completion/available/lerna.completion.bash @@ -0,0 +1,25 @@ +#!/bin/bash +# Usage: +# +# To enable bash completion for lerna, add the following line (minus the +# leading #, which is the bash comment character) to your ~/.bashrc file: +# +# eval "$(lerna --completion=bash)" +# Enable bash autocompletion. +function _lerna_completions() { + # The currently-being-completed word. + local cur compls + + cur="${COMP_WORDS[COMP_CWORD]}" + + # Options + compls="add bootstrap changed clean create diff exec \ + import init link list publish run version \ + --loglevel --concurrency --reject-cycles \ + --progress --sort --no-sort --help \ + --version" + + # Tell complete what stuff to show. + COMPREPLY=($(compgen -W "$compls" -- "$cur")) +} +complete -o default -F _lerna_completions lerna From b9c34cb9c297989581cf743cece984e8d4e34b05 Mon Sep 17 00:00:00 2001 From: "William A. O. Brown" Date: Thu, 25 Oct 2018 21:40:57 +0100 Subject: [PATCH 2/2] Remove some comments --- completion/available/lerna.completion.bash | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/completion/available/lerna.completion.bash b/completion/available/lerna.completion.bash index f8439d3e..792ea27b 100644 --- a/completion/available/lerna.completion.bash +++ b/completion/available/lerna.completion.bash @@ -1,15 +1,9 @@ #!/bin/bash -# Usage: -# -# To enable bash completion for lerna, add the following line (minus the -# leading #, which is the bash comment character) to your ~/.bashrc file: -# -# eval "$(lerna --completion=bash)" -# Enable bash autocompletion. +# Lerna autocompletion. function _lerna_completions() { - # The currently-being-completed word. local cur compls + # The currently-being-completed word. cur="${COMP_WORDS[COMP_CWORD]}" # Options