forked from toolshed/abra
refactor: centralise app name validation
This commit is contained in:
@ -31,10 +31,7 @@ var appRestoreCommand = &cli.Command{
|
||||
Flags: []cli.Flag{restoreAllServicesFlag},
|
||||
ArgsUsage: "<service> [<backup file>]",
|
||||
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().Len() > 1 && restoreAllServices {
|
||||
internal.ShowSubcommandHelpAndError(c, errors.New("cannot use <service>/<backup file> and '--all' together"))
|
||||
|
Reference in New Issue
Block a user