最終更新 1 month ago

修正履歴 8f410ec05d3366126ea2913b244932893dd8eb60

gistfile1.txt Raw
1function 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}