API updates and fixes to CLI

This commit is contained in:
Gregory Kurtzer
2020-12-01 23:34:24 -08:00
parent 2f5fa95d14
commit 43ad7e570c
26 changed files with 168 additions and 163 deletions

View File

@@ -24,6 +24,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
os.Exit(1)
}
if len(args) == 0 {
args = append(args, "default")
}
if SetAll == true {
var tmp []node.ProfileInfo
tmp, err = nodeDB.FindAllProfiles()
@@ -36,7 +40,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
profiles = append(profiles, p)
}
} else if len(args) > 0 {
} else {
var tmp []node.ProfileInfo
tmp, err = nodeDB.FindAllProfiles()
if err != nil {
@@ -51,10 +55,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
}
}
} else {
cmd.Usage()
os.Exit(1)
}
for _, p := range profiles {