Skip to content

Commit 9db7985

Browse files
committed
update usage strings for consistency
This updates the format of various usage strings to be more consistent with other parts of the CLI. - Use `[OPTIONS]` to indicate where command-specific options should be added - Use `[SERVICE...]` to indicate zero-or-more services - Remove some usage strings for specific options (e.g. `-e NAME=VAL`), as that option is part of the already mentioned `[OPTIONS]` and we don't provide usage for each possible option that can be passed. - Remove `[--]`, which (I think) was needed for the Python implementation, but is a general feature to stop processing flag-options. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 5ead5d1 commit 9db7985

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+41
-41
lines changed

cmd/compose/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func buildCommand(p *projectOptions, backend api.Service) *cobra.Command {
7777
projectOptions: p,
7878
}
7979
cmd := &cobra.Command{
80-
Use: "build [SERVICE...]",
80+
Use: "build [OPTIONS] [SERVICE...]",
8181
Short: "Build or rebuild services",
8282
PreRunE: Adapt(func(ctx context.Context, args []string) error {
8383
if opts.memory != "" {

cmd/compose/convert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
5858
}
5959
cmd := &cobra.Command{
6060
Aliases: []string{"config"},
61-
Use: "convert SERVICES",
61+
Use: "convert [OPTIONS] [SERVICE...]",
6262
Short: "Converts the compose file to platform's canonical format",
6363
PreRunE: Adapt(func(ctx context.Context, args []string) error {
6464
if opts.quiet {

cmd/compose/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type createOptions struct {
4545
func createCommand(p *projectOptions, backend api.Service) *cobra.Command {
4646
opts := createOptions{}
4747
cmd := &cobra.Command{
48-
Use: "create [SERVICE...]",
48+
Use: "create [OPTIONS] [SERVICE...]",
4949
Short: "Creates containers for a service.",
5050
PreRunE: Adapt(func(ctx context.Context, args []string) error {
5151
if opts.Build && opts.noBuild {

cmd/compose/down.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func downCommand(p *projectOptions, backend api.Service) *cobra.Command {
4545
projectOptions: p,
4646
}
4747
downCmd := &cobra.Command{
48-
Use: "down",
48+
Use: "down [OPTIONS]",
4949
Short: "Stop and remove containers, networks",
5050
PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
5151
opts.timeChanged = cmd.Flags().Changed("timeout")

cmd/compose/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func eventsCommand(p *projectOptions, backend api.Service) *cobra.Command {
3838
},
3939
}
4040
cmd := &cobra.Command{
41-
Use: "events [options] [--] [SERVICE...]",
41+
Use: "events [OPTIONS] [SERVICE...]",
4242
Short: "Receive real time events from containers.",
4343
RunE: Adapt(func(ctx context.Context, args []string) error {
4444
return runEvents(ctx, backend, opts, args)

cmd/compose/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func execCommand(p *projectOptions, dockerCli command.Cli, backend api.Service)
5050
},
5151
}
5252
runCmd := &cobra.Command{
53-
Use: "exec [options] [-e KEY=VAL...] [--] SERVICE COMMAND [ARGS...]",
53+
Use: "exec [OPTIONS] SERVICE COMMAND [ARGS...]",
5454
Short: "Execute a command in a running container.",
5555
Args: cobra.MinimumNArgs(2),
5656
PreRunE: Adapt(func(ctx context.Context, args []string) error {

cmd/compose/images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func imagesCommand(p *projectOptions, backend api.Service) *cobra.Command {
4343
projectOptions: p,
4444
}
4545
imgCmd := &cobra.Command{
46-
Use: "images [SERVICE...]",
46+
Use: "images [OPTIONS] [SERVICE...]",
4747
Short: "List images used by the created containers",
4848
RunE: Adapt(func(ctx context.Context, args []string) error {
4949
return runImages(ctx, backend, opts, args)

cmd/compose/kill.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func killCommand(p *projectOptions, backend api.Service) *cobra.Command {
3434
projectOptions: p,
3535
}
3636
cmd := &cobra.Command{
37-
Use: "kill [options] [SERVICE...]",
37+
Use: "kill [OPTIONS] [SERVICE...]",
3838
Short: "Force stop service containers.",
3939
RunE: Adapt(func(ctx context.Context, args []string) error {
4040
return runKill(ctx, backend, opts, args)

cmd/compose/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type lsOptions struct {
4141
func listCommand(backend api.Service) *cobra.Command {
4242
lsOpts := lsOptions{Filter: opts.NewFilterOpt()}
4343
lsCmd := &cobra.Command{
44-
Use: "ls",
44+
Use: "ls [OPTIONS]",
4545
Short: "List running compose projects",
4646
RunE: Adapt(func(ctx context.Context, args []string) error {
4747
return runList(ctx, backend, lsOpts)

cmd/compose/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func logsCommand(p *projectOptions, backend api.Service) *cobra.Command {
4444
projectOptions: p,
4545
}
4646
logsCmd := &cobra.Command{
47-
Use: "logs [SERVICE...]",
47+
Use: "logs [OPTIONS] [SERVICE...]",
4848
Short: "View output from containers",
4949
RunE: Adapt(func(ctx context.Context, args []string) error {
5050
return runLogs(ctx, backend, opts, args)

0 commit comments

Comments
 (0)