add 'contain' command for common configs

add flag 'full' for 'get' command
update bash complete
This commit is contained in:
DeniskaRediska committed 2019-10-30 14:58:50 +03:00
1 parent 1a3458ebdd
commit 8b8815d2f2
21 files changed
+348 -54

No files matched your search

+9 -4
View File
@@ -15,7 +15,7 @@ func Remove() cli.Command {
Name: "remove",
Usage: "remove common configurations",
Action: remove.action,
BashComplete: bash.CommonConfig.Remove,
BashComplete: bash.CommonConfig.ConfigName,
}
}
@@ -44,13 +44,18 @@ func (g removeCommand) action(ctx *cli.Context) {
config, ok := commonConfigs[ccName]
if !ok {
utils.PrintError(errors.Errorf("common config %s not found", ccName))
utils.PrintError(errors.Errorf("common config [%s] not found", ccName))
return
}
if deleted, err := service.Config.DeleteCommonConfig(config.Id); err != nil {
links, deleted, err := service.Config.DeleteCommonConfig(config.Id)
if err != nil {
utils.PrintError(err)
return
}
if deleted {
fmt.Printf("config [%s] deleted", config.Name)
} else {
fmt.Printf("count deleted config: %d\n", deleted)
fmt.Printf("config [%s] not deleted, need unlink in next modules:\n%v\n", config.Name, links)
}
}