Addressing small nits

Signed-off-by: Diogo Monica <diogo@docker.com>
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
This commit is contained in:
Diogo Monica 2015-11-11 11:50:18 -08:00 committed by David Lawrence
parent 0344dfc038
commit 4c2fcda620
2 changed files with 4 additions and 2 deletions

View File

@ -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)")

View File

@ -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)