This repository has been archived on 2020-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
node-spearhead/etc/triton-bash-completion-types.sh
Marsell Kukuljevic 634350018a PUBAPI-1233/PUBAPI-1234 Add firewalls and snapshots to node-triton
triton fwrule ...
triton instance snapshot ...

Reviewed-By: Trent Mick (with some contributions)
2016-03-01 22:38:21 -08:00

22 lines
679 B
Bash

# Functions for Bash completion of some 'triton' option/arg types.
function complete_tritonprofile {
local word="$1"
local candidates
candidates=$(ls -1 ~/.triton/profiles.d/*.json 2>/dev/null \
| sed -E 's/^.*\/([^\/]+)\.json$/\1/')
compgen $compgen_opts -W "$candidates" -- "$word"
}
function complete_tritonupdateaccountfield {
local word="$1"
local candidates
candidates="{{UPDATE_ACCOUNT_FIELDS}}"
compgen $compgen_opts -W "$candidates" -- "$word"
}
function complete_tritonupdatefwrulefield {
local word="$1"
local candidates
candidates="{{UPDATE_FWRULE_FIELDS}}"
compgen $compgen_opts -W "$candidates" -- "$word"
}