nuno a révisé ce gist 1 month ago. Aller à la révision
1 file changed, 30 insertions
gistfile1.txt(fichier créé)
| @@ -0,0 +1,30 @@ | |||
| 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 | + | } | |
Plus récent
Plus ancien