From 4c2fcda62072e9183b235b2397184361ef343e45 Mon Sep 17 00:00:00 2001 From: Diogo Monica Date: Wed, 11 Nov 2015 11:50:18 -0800 Subject: [PATCH] Addressing small nits Signed-off-by: Diogo Monica Signed-off-by: David Lawrence Signed-off-by: Diogo Monica (github: endophage) --- cmd/notary/keys.go | 2 ++ cmd/notary/main.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/notary/keys.go b/cmd/notary/keys.go index 8e014c52f5..e8d2554c00 100644 --- a/cmd/notary/keys.go +++ b/cmd/notary/keys.go @@ -137,6 +137,8 @@ func keysList(cmd *cobra.Command, args []string) { } func keysGenerateRootKey(cmd *cobra.Command, args []string) { + // We require one or no arguments (since we have a default value), but if the + // user passes in more than one argument, we error out. if len(args) > 1 { cmd.Usage() fatalf("Please provide only one Algorithm as an argument to generate (rsa, ecdsa)") diff --git a/cmd/notary/main.go b/cmd/notary/main.go index 805ef928eb..7031a38068 100644 --- a/cmd/notary/main.go +++ b/cmd/notary/main.go @@ -82,13 +82,13 @@ func parseConfig() { } // At this point we either have the default value or the one set by the config. - // Either way, the command-line flag has precedence and overwrives the value + // Either way, the command-line flag has precedence and overwrites the value if trustDir != "" { mainViper.Set("trust_dir", trustDir) } // Expands all the possible ~/ that have been given, either through -d or config - // If there is no error, user it, if not, attempt to use whatever the user gave us + // If there is no error, use it, if not, attempt to use whatever the user gave us expandedTrustDir, err := homedir.Expand(mainViper.GetString("trust_dir")) if err == nil { mainViper.Set("trust_dir", expandedTrustDir)