Shell completions
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
From https://github.com/filecoin-project/go-filecoin/tree/master/scripts
|
||||
|
||||
Try to keep in sync
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
_cli_bash_autocomplete() {
|
||||
local cur opts base;
|
||||
COMPREPLY=();
|
||||
cur="${COMP_WORDS[COMP_CWORD]}";
|
||||
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-completion );
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
||||
return 0;
|
||||
};
|
||||
complete -F _cli_bash_autocomplete lotus
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
_cli_bash_autocomplete() {
|
||||
local cur opts base;
|
||||
COMPREPLY=();
|
||||
cur="${COMP_WORDS[COMP_CWORD]}";
|
||||
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-completion );
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
||||
return 0;
|
||||
};
|
||||
complete -F _cli_bash_autocomplete lotus-storage-miner
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# scripts/make-completions.sh [progname]
|
||||
|
||||
echo '#!/usr/bin/env bash' > "scripts/bash-completion/$1"
|
||||
echo '#!/usr/bin/env zsh' > "scripts/zsh-completion/$1"
|
||||
|
||||
$1 --init-completion=bash >> "scripts/bash-completion/$1"
|
||||
$1 --init-completion=zsh >> "scripts/zsh-completion/$1"
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env zsh
|
||||
autoload -U compinit && compinit;
|
||||
autoload -U bashcompinit && bashcompinit;
|
||||
_cli_bash_autocomplete() {
|
||||
local cur opts base;
|
||||
COMPREPLY=();
|
||||
cur="${COMP_WORDS[COMP_CWORD]}";
|
||||
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-completion );
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
||||
return 0;
|
||||
};
|
||||
complete -F _cli_bash_autocomplete lotus
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env zsh
|
||||
autoload -U compinit && compinit;
|
||||
autoload -U bashcompinit && bashcompinit;
|
||||
_cli_bash_autocomplete() {
|
||||
local cur opts base;
|
||||
COMPREPLY=();
|
||||
cur="${COMP_WORDS[COMP_CWORD]}";
|
||||
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-completion );
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
||||
return 0;
|
||||
};
|
||||
complete -F _cli_bash_autocomplete lotus-storage-miner
|
||||
Reference in New Issue
Block a user