From 8010b8e6f867a9eb4339b270b59d29f1809b3d58 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 23 Dec 2018 07:04:38 -0500 Subject: [PATCH] refactor: move filename to flag --- README.md | 7 ++++--- main.go | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 62286d9..4f6d0f9 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,14 @@ make build ## usage ``` -Usage: sshd-config [] +Usage: sshd-config [] [--filename=] sshd-config -h | --help sshd-config --version Options: - -h --help Show this screen. - --version Show version. + -h --help Show this screen. + --version Show version. + --filename= The sshd-config to modify [default: /etc/ssh/sshd_config] Commands: add Add a value to a key diff --git a/main.go b/main.go index b7b37fd..e2984db 100644 --- a/main.go +++ b/main.go @@ -135,13 +135,14 @@ func commandUnset(arguments docopt.Opts, entries map[string]entry, filename stri func main() { usage := `sshd-config. -Usage: sshd-config [] +Usage: sshd-config [] [--filename=] sshd-config -h | --help sshd-config --version Options: - -h --help Show this screen. - --version Show version. + -h --help Show this screen. + --version Show version. + --filename= The sshd-config to modify [default: /etc/ssh/sshd_config] Commands: add Add a value to a key @@ -151,7 +152,7 @@ Commands: arguments, _ := docopt.ParseArgs(usage, os.Args[1:], "0.1.0") - filename, err := arguments.String("") + filename, err := arguments.String("--filename") if err != nil { log.Printf("error: %s", err) }