add truffle cli bash completions

pull/2107/head
Gurkirat Singh 2022-03-06 04:09:59 +05:30 committed by GitHub
parent 3a778072db
commit 5126a20a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,61 @@
# shellcheck shell=bash
__truffle_completion() {
local prev=$(_get_pword)
local curr=$(_get_cword)
case $prev in
compile)
COMPREPLY=(--{list,all,network,quiet})
;;
config)
COMPREPLY=(--{enable,disable}-analytics get set list)
;;
console)
COMPREPLY=(--{network,verbose-rpc})
;;
create)
COMPREPLY=(contract migration test all)
;;
dashboard)
COMPREPLY=(--{port,host,verbose})
;;
debug)
COMPREPLY=(--{network,url,fetch-external,compile-{tests,all}})
;;
develop)
COMPREPLY=(--log)
;;
exec)
COMPREPLY=(--{network,compile})
;;
debug)
COMPREPLY=(--force)
;;
migrate)
COMPREPLY=(--{reset,f,to,network,compile-all,verbose-rpc,{,skip-}dry-run,interactive,describe-json})
;;
networks)
COMPREPLY=(--clean)
;;
obtain)
COMPREPLY=(--solc)
;;
preserve)
COMPREPLY=(--{ipfs,file-coin,environment,})
;;
unbox)
COMPREPLY=(--force)
;;
test)
COMPREPLY=(--{compile-all{,-debug},network,verbose-rpc,show-events,debug{,-global},bail,stacktrace{,-extra}})
;;
truffle)
COMPREPLY=(build compile config console create dashboard browser db debug deploy develop exec help init install migrate networks obtain opcode preserve publish run test unbox version watch)
;;
esac
}
if _command_exists truffle; then
complete -F __truffle_completion -X "!&*" truffle
fi