Skip to content

Commit

Permalink
Change 'flag' to 'option' in commands and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiamac committed Dec 6, 2018
1 parent 3bc13da commit 7fc0bbd
Show file tree
Hide file tree
Showing 233 changed files with 710 additions and 476 deletions.
7 changes: 4 additions & 3 deletions cmd/juju/action/cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
"fmt"

"github.com/juju/cmd"
errors "github.com/juju/errors"
"github.com/juju/errors"
"github.com/juju/gnuflag"
"gopkg.in/juju/names.v2"

"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/cmd/output"
)
Expand All @@ -36,12 +37,12 @@ const cancelDoc = `
Cancel actions matching given IDs or partial ID prefixes.`

func (c *cancelCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "cancel-action",
Args: "<<action ID | action ID prefix>...>",
Purpose: "Cancel pending actions.",
Doc: cancelDoc,
}
})
}

func (c *cancelCommand) Init(args []string) error {
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/action/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"gopkg.in/juju/names.v2"

"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/cmd/output"
)
Expand Down Expand Up @@ -62,13 +63,13 @@ func (c *listCommand) SetFlags(f *gnuflag.FlagSet) {
}

func (c *listCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "actions",
Args: "<application name>",
Purpose: "List actions defined for an application.",
Doc: listDoc,
Aliases: []string{"list-actions"},
}
})
}

// Init validates the application name and any other options.
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/action/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"gopkg.in/yaml.v2"

"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/common"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/cmd/output"
Expand Down Expand Up @@ -149,12 +150,12 @@ func (c *runCommand) SetFlags(f *gnuflag.FlagSet) {
}

func (c *runCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "run-action",
Args: "<unit> [<unit> ...] <action name> [key.key.key...=value]",
Purpose: "Queue an action for execution.",
Doc: runDoc,
}
})
}

// Init gets the unit tag(s), action name and action arguments.
Expand Down
7 changes: 4 additions & 3 deletions cmd/juju/action/showoutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (
"time"

"github.com/juju/cmd"
errors "github.com/juju/errors"
"github.com/juju/errors"
"github.com/juju/gnuflag"

"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/cmd/output"
)
Expand Down Expand Up @@ -48,12 +49,12 @@ func (c *showOutputCommand) SetFlags(f *gnuflag.FlagSet) {
}

func (c *showOutputCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "show-action-output",
Args: "<action ID>",
Purpose: "Show results of an action by ID.",
Doc: showOutputDoc,
}
})
}

// Init validates the action ID and any other options.
Expand Down
7 changes: 4 additions & 3 deletions cmd/juju/action/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
"time"

"github.com/juju/cmd"
errors "github.com/juju/errors"
"github.com/juju/errors"
"github.com/juju/gnuflag"
"gopkg.in/juju/names.v2"

"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/cmd/output"
)
Expand Down Expand Up @@ -41,12 +42,12 @@ func (c *statusCommand) SetFlags(f *gnuflag.FlagSet) {
}

func (c *statusCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "show-action-status",
Args: "[<action ID>|<action ID prefix>]",
Purpose: "Show results of all actions filtered by optional ID prefix.",
Doc: statusDoc,
}
})
}

func (c *statusCommand) Init(args []string) error {
Expand Down
3 changes: 2 additions & 1 deletion cmd/juju/application/addrelation.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/juju/juju/api/application"
"github.com/juju/juju/api/applicationoffers"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/juju/common"
"github.com/juju/juju/cmd/modelcmd"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (c *addRelationCommand) Info() *cmd.Info {
Purpose: "Add a relation between two application endpoints.",
Doc: addRelationDoc,
}
return addCmd
return jujucmd.Info(addCmd)
}

func (c *addRelationCommand) Init(args []string) error {
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/addunit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/juju/juju/api/application"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/juju/common"
"github.com/juju/juju/cmd/modelcmd"
Expand Down Expand Up @@ -162,12 +163,12 @@ type addUnitCommand struct {
}

func (c *addUnitCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "add-unit",
Args: "<application name>",
Purpose: usageAddUnitSummary,
Doc: usageAddUnitDetails,
}
})
}

// IncompatibleModel returns an error if the command is being run against
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/bundlediff.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/juju/juju/api/base"
"github.com/juju/juju/api/modelconfig"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/constraints"
)
Expand Down Expand Up @@ -73,12 +74,12 @@ func (c *bundleDiffCommand) AllowInterspersedFlags() bool { return true }

// Info is part of cmd.Command.
func (c *bundleDiffCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "diff-bundle",
Args: "<bundle file or name>",
Purpose: "Compare a bundle with a model and report any differences.",
Doc: bundleDiffDoc,
}
})
}

// SetFlags is part of cmd.Command.
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/juju/juju/api/application"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/cmd/output"
Expand Down Expand Up @@ -104,12 +105,12 @@ type applicationAPI interface {

// Info is part of the cmd.Command interface.
func (c *configCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "config",
Args: "<application name> [--reset <key[,key]>] [<attribute-key>][=<value>] ...]",
Purpose: configSummary,
Doc: configDetails,
}
})
}

// SetFlags is part of the cmd.Command interface.
Expand Down
9 changes: 5 additions & 4 deletions cmd/juju/application/constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"gopkg.in/juju/names.v2"

"github.com/juju/juju/api/application"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/constraints"
Expand Down Expand Up @@ -101,12 +102,12 @@ type applicationGetConstraintsCommand struct {
}

func (c *applicationGetConstraintsCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "get-constraints",
Args: "<application>",
Purpose: usageGetConstraintsSummary,
Doc: usageGetConstraintsDetails,
}
})
}

func formatConstraints(writer io.Writer, value interface{}) error {
Expand Down Expand Up @@ -160,12 +161,12 @@ func NewApplicationSetConstraintsCommand() modelcmd.ModelCommand {
}

func (c *applicationSetConstraintsCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "set-constraints",
Args: "<application> <constraint>=<value> ...",
Purpose: usageSetConstraintsSummary,
Doc: usageSetConstraintsDetails,
}
})
}

func (c *applicationSetConstraintsCommand) Init(args []string) (err error) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/juju/juju/api/application"
"github.com/juju/juju/api/applicationoffers"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/modelcmd"
"github.com/juju/juju/core/crossmodel"
)
Expand Down Expand Up @@ -52,12 +53,12 @@ type consumeCommand struct {

// Info implements cmd.Command.
func (c *consumeCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "consume",
Args: "<remote offer path> [<local application name>]",
Purpose: usageConsumeSummary,
Doc: usageConsumeDetails,
}
})
}

// Init implements cmd.Command.
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
app "github.com/juju/juju/apiserver/facades/client/application"
apiparams "github.com/juju/juju/apiserver/params"
"github.com/juju/juju/charmstore"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/juju/common"
"github.com/juju/juju/cmd/modelcmd"
Expand Down Expand Up @@ -656,12 +657,12 @@ type DeploymentInfo struct {
}

func (c *DeployCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "deploy",
Args: "<charm or bundle> [<application name>]",
Purpose: "Deploys a new application or bundle.",
Doc: deployDoc,
}
})
}

var (
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/expose.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/juju/errors"

"github.com/juju/juju/api/application"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/modelcmd"
)
Expand Down Expand Up @@ -37,12 +38,12 @@ type exposeCommand struct {
}

func (c *exposeCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "expose",
Args: "<application name>",
Purpose: usageExposeSummary,
Doc: usageExposeDetails,
}
})
}

func (c *exposeCommand) Init(args []string) error {
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/removeapplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/juju/juju/api/application"
"github.com/juju/juju/api/storage"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/modelcmd"
)
Expand Down Expand Up @@ -47,12 +48,12 @@ Examples:
juju remove-application -m test-model mariadb`[1:]

func (c *removeApplicationCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "remove-application",
Args: "<application> [<application>...]",
Purpose: helpSummaryRmApp,
Doc: helpDetailsRmApp,
}
})
}

func (c *removeApplicationCommand) SetFlags(f *gnuflag.FlagSet) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/removerelation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/juju/errors"

"github.com/juju/juju/api/application"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/modelcmd"
)
Expand Down Expand Up @@ -70,12 +71,12 @@ type removeRelationCommand struct {
}

func (c *removeRelationCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "remove-relation",
Args: "<application1>[:<relation name1>] <application2>[:<relation name2>] | <relation-id>",
Purpose: helpSummary,
Doc: helpDetails,
}
})
}

func (c *removeRelationCommand) Init(args []string) (err error) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/juju/application/removesaas.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/juju/juju/api/application"
"github.com/juju/juju/apiserver/params"
jujucmd "github.com/juju/juju/cmd"
"github.com/juju/juju/cmd/juju/block"
"github.com/juju/juju/cmd/modelcmd"
)
Expand Down Expand Up @@ -48,13 +49,13 @@ Examples:
juju remove-saas -m test-model hosted-mariadb`[1:]

func (c *removeSaasCommand) Info() *cmd.Info {
return &cmd.Info{
return jujucmd.Info(&cmd.Info{
Name: "remove-saas",
Args: "<saas-application-name> [<saas-application-name>...]",
Aliases: []string{"remove-consumed-application"},
Purpose: helpSummaryRmSaas,
Doc: helpDetailsRmSaas,
}
})
}

func (c *removeSaasCommand) Init(args []string) error {
Expand Down
Loading

0 comments on commit 7fc0bbd

Please sign in to comment.