refactor!: migrate to urfave/cli v1
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Better flexible flags handling.
This commit is contained in:
@ -12,7 +12,7 @@ import (
|
||||
"coopcloud.tech/abra/pkg/ssh"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
// AppName is used for configuring app name programmatically
|
||||
@ -160,9 +160,9 @@ func ValidateDomain(c *cli.Context) (string, error) {
|
||||
|
||||
// ValidateSubCmdFlags ensures flag order conforms to correct order
|
||||
func ValidateSubCmdFlags(c *cli.Context) bool {
|
||||
for argIdx, arg := range c.Args().Slice() {
|
||||
for argIdx, arg := range c.Args() {
|
||||
if !strings.HasPrefix(arg, "--") {
|
||||
for _, flag := range c.Args().Slice()[argIdx:] {
|
||||
for _, flag := range c.Args()[argIdx:] {
|
||||
if strings.HasPrefix(flag, "--") {
|
||||
return false
|
||||
}
|
||||
@ -369,7 +369,7 @@ func EnsureNewCapsulVPSFlags(c *cli.Context) error {
|
||||
if err := survey.AskOne(prompt, &CapsulSSHKeys); err != nil {
|
||||
return err
|
||||
}
|
||||
CapsulSSHKeys = *cli.NewStringSlice(strings.Split(sshKeys, ",")...)
|
||||
CapsulSSHKeys = cli.StringSlice(strings.Split(sshKeys, ","))
|
||||
}
|
||||
|
||||
if CapsulAPIToken == "" && !NoInput {
|
||||
@ -448,7 +448,7 @@ func EnsureNewHetznerCloudVPSFlags(c *cli.Context) error {
|
||||
if err := survey.AskOne(prompt, &sshKeys); err != nil {
|
||||
return err
|
||||
}
|
||||
HetznerCloudSSHKeys = *cli.NewStringSlice(strings.Split(sshKeys, ",")...)
|
||||
HetznerCloudSSHKeys = cli.StringSlice(strings.Split(sshKeys, ","))
|
||||
}
|
||||
|
||||
if !NoInput {
|
||||
|
Reference in New Issue
Block a user