mirror of https://github.com/docker/docs.git
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:
parent
0344dfc038
commit
4c2fcda620
|
|
@ -137,6 +137,8 @@ func keysList(cmd *cobra.Command, args []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func keysGenerateRootKey(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 {
|
if len(args) > 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
fatalf("Please provide only one Algorithm as an argument to generate (rsa, ecdsa)")
|
fatalf("Please provide only one Algorithm as an argument to generate (rsa, ecdsa)")
|
||||||
|
|
|
||||||
|
|
@ -82,13 +82,13 @@ func parseConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// At this point we either have the default value or the one set by the config.
|
// 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 != "" {
|
if trustDir != "" {
|
||||||
mainViper.Set("trust_dir", trustDir)
|
mainViper.Set("trust_dir", trustDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expands all the possible ~/ that have been given, either through -d or config
|
// 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"))
|
expandedTrustDir, err := homedir.Expand(mainViper.GetString("trust_dir"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
mainViper.Set("trust_dir", expandedTrustDir)
|
mainViper.Set("trust_dir", expandedTrustDir)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue