gistfile1.txt
· 630 B · Text
Surowy
function cmd::config::run() {
local name=""
local type=""
while [[ $# -gt 0 ]]; do
case "$1" in
--name) name="$2"; shift 2 ;;
--type) type="$2"; shift 2 ;;
--help) cmd::config::help; return ;;
*)
log::error "Unknown flag: $1"
cmd::config::help
return 1
;;
esac
done
if [[ -z "$name" ]]; then
log::error "Missing required flag: --name"
return 1
fi
name=$(peers::resolve_and_require "$name" "$type") || return 1
local conf
conf="$(ctx::clients)/${name}.conf"
log::section "Client Config: ${name}"
cat "$conf"
}
| 1 | function cmd::config::run() { |
| 2 | local name="" |
| 3 | local type="" |
| 4 | |
| 5 | while [[ $# -gt 0 ]]; do |
| 6 | case "$1" in |
| 7 | --name) name="$2"; shift 2 ;; |
| 8 | --type) type="$2"; shift 2 ;; |
| 9 | --help) cmd::config::help; return ;; |
| 10 | *) |
| 11 | log::error "Unknown flag: $1" |
| 12 | cmd::config::help |
| 13 | return 1 |
| 14 | ;; |
| 15 | esac |
| 16 | done |
| 17 | |
| 18 | if [[ -z "$name" ]]; then |
| 19 | log::error "Missing required flag: --name" |
| 20 | return 1 |
| 21 | fi |
| 22 | |
| 23 | name=$(peers::resolve_and_require "$name" "$type") || return 1 |
| 24 | |
| 25 | local conf |
| 26 | conf="$(ctx::clients)/${name}.conf" |
| 27 | |
| 28 | log::section "Client Config: ${name}" |
| 29 | cat "$conf" |
| 30 | } |