Skip to content

Commit

Permalink
CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Feb 24, 2021
1 parent 96fa0b8 commit 803bc6c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions artifactory/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ func useCmd(c *cli.Context) error {
if len(c.Args()) != 1 {
return cliutils.PrintHelpAndReturnError("Wrong number of arguments.", c)
}
log.Warn(`You are using a deprecated syntax of the "jfrog rt use" command. Use "jfrog config use" instead.`)
log.Warn(`The "jfrog rt use" command is deprecated. Please use "jfrog config use" instead.`)
return coreCommonCommands.Use(c.Args()[0])
}

Expand All @@ -1128,12 +1128,12 @@ func configCmd(c *cli.Context) error {
return cliutils.PrintHelpAndReturnError("Wrong number of arguments.", c)
}

log.Warn(`You are using a deprecated syntax of the "jfrog rt config" commands.
Use "jfrog config add", "jfrog config edit", "jfrog config show", "jfrog config remove", "jfrog config import" or "jfrog config export" respectfully.
In the new command, if "--url" flag is used, replaced it by "--artifactory-url".
log.Warn(`The "jfrog rt config" command is deprecated. Please use "jfrog config" command instead. You can use it as follows:
The command includes the following sub-commands - "jfrog config add", "jfrog config edit", "jfrog config show", "jfrog config remove", "jfrog config import" and "jfrog config export".
Important: When switching to the new command, please replace "--url" with "--artifactory-url".
For example:
Old syntax: "jfrog rt config <server-id> --url=<artifactoryUrl>"
New syntax: "jfrog config create <server-id> --artifactory-url=<artifactory-url>"`)
New syntax: "jfrog config add <server-id> --artifactory-url=<artifactory-url>"`)

var serverId string
configCommandConfiguration, err := config.CreateConfigCommandConfiguration(c)
Expand Down Expand Up @@ -3526,7 +3526,7 @@ func validateConfigFlags(configCommandConfiguration *coreCommonCommands.ConfigCo
if !configCommandConfiguration.Interactive && configCommandConfiguration.ServerDetails.ArtifactoryUrl == "" {
return errors.New("the --url option is mandatory when the --interactive option is set to false or the CI environment variable is set to true.")
}
// Validate the option is not used along an access token
// Validate the option is not used along with an access token
if configCommandConfiguration.BasicAuthOnly && configCommandConfiguration.ServerDetails.AccessToken != "" {
return errors.New("the --basic-auth-only option is only supported when username and password/API key are provided")
}
Expand Down
6 changes: 3 additions & 3 deletions config/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func editCmd(c *cli.Context) error {
return addOrEdit(c, true)
}

func addOrEdit(c *cli.Context, expectExist bool) error {
func addOrEdit(c *cli.Context, expectExists bool) error {
configCommandConfiguration, err := CreateConfigCommandConfiguration(c)
if err != nil {
return err
Expand All @@ -122,7 +122,7 @@ func addOrEdit(c *cli.Context, expectExist bool) error {
if err := ValidateServerId(serverId); err != nil {
return err
}
if err := validateServerExistence(serverId, expectExist); err != nil {
if err := validateServerExistence(serverId, expectExists); err != nil {
return err
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ func validateConfigFlags(configCommandConfiguration *commands.ConfigCommandConfi
if !configCommandConfiguration.Interactive && configCommandConfiguration.ServerDetails.ArtifactoryUrl == "" {
return errors.New("the --artifactory-url option is mandatory when the --interactive option is set to false or the CI environment variable is set to true.")
}
// Validate the option is not used along an access token
// Validate the option is not used along with an access token
if configCommandConfiguration.BasicAuthOnly && configCommandConfiguration.ServerDetails.AccessToken != "" {
return errors.New("the --basic-auth-only option is only supported when username and password/API key are provided")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/config/add/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ var Usage = []string{"jfrog config add",
"jfrog config add <server ID>"}

const Arguments string = ` server ID
A unique ID for the new server configuration.`
The configured server ID.`
2 changes: 1 addition & 1 deletion docs/config/edit/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const Description string = `Edits a server configuration.`
var Usage = []string{"jfrog config edit <server ID>"}

const Arguments string = ` server ID
A unique ID for the modified server configuration.`
The configured server ID.`
2 changes: 1 addition & 1 deletion docs/config/exportcmd/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const Description string = `Creates a server configuration token. The generated
var Usage = []string{"jfrog config export <server token>"}

const Arguments string = ` server ID
A unique ID for the new server configuration.`
The configured server ID.`
2 changes: 1 addition & 1 deletion docs/config/importcmd/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const Description string = `Imports a server configuration from a server token.
var Usage = []string{"jfrog config import <server token>"}

const Arguments string = ` server token
Token generated by the "jfrog rt c export <Server ID>" command.`
Token generated by the "jfrog config export <Server ID>" command.`
2 changes: 1 addition & 1 deletion docs/config/show/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ const Description string = `Shows the stored configuration. In case this argumen
var Usage = []string{"jfrog config show <server ID>"}

const Arguments string = ` server ID
A unique ID for the new server configuration.`
The configured server ID.`
2 changes: 1 addition & 1 deletion utils/cliutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func ShouldOfferConfig() (bool, error) {
msg := fmt.Sprintf("To avoid this message in the future, set the %s environment variable to false.\n"+
"The CLI commands require the URL and authentication details\n"+
"Configuring JFrog CLI with these parameters now will save you having to include them as command options.\n"+
"You can also configure these parameters later using the 'jfrog rt c' command.\n"+
"You can also configure these parameters later using the 'jfrog c' command.\n"+
"Configure now?", OfferConfig)
confirmed := coreutils.AskYesNo(msg, false)
if !confirmed {
Expand Down

0 comments on commit 803bc6c

Please sign in to comment.