refactor: centralise app name validation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -31,10 +31,7 @@ var appBackupCommand = &cli.Command{
|
||||
Flags: []cli.Flag{backupAllServicesFlag},
|
||||
ArgsUsage: "<service>",
|
||||
Action: func(c *cli.Context) error {
|
||||
appName := c.Args().First()
|
||||
if appName == "" {
|
||||
internal.ShowSubcommandHelpAndError(c, errors.New("no app name provided"))
|
||||
}
|
||||
appName := internal.ValidateAppNameArg(c)
|
||||
|
||||
if c.Args().Get(1) != "" && backupAllServices {
|
||||
internal.ShowSubcommandHelpAndError(c, errors.New("cannot use '<service>' and '--all' together"))
|
||||
|
Reference in New Issue
Block a user