Skip to content

Commit

Permalink
Merge pull request #8232 from panguicai008/flag-usage
Browse files Browse the repository at this point in the history
Flag usage uses uppercase letters
  • Loading branch information
dmcgowan committed Mar 9, 2023
2 parents 2168015 + 5c9c630 commit 0fe3b49
Show file tree
Hide file tree
Showing 38 changed files with 84 additions and 84 deletions.
4 changes: 2 additions & 2 deletions cmd/ctr/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ containerd CLI
},
cli.StringFlag{
Name: "address, a",
Usage: "address for containerd's GRPC server",
Usage: "Address for containerd's GRPC server",
Value: defaults.DefaultAddress,
EnvVar: "CONTAINERD_ADDRESS",
},
Expand All @@ -96,7 +96,7 @@ containerd CLI
},
cli.StringFlag{
Name: "namespace, n",
Usage: "namespace to use with commands",
Usage: "Namespace to use with commands",
Value: namespaces.Default,
EnvVar: namespaces.NamespaceEnvVar,
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var (
SnapshotterFlags = []cli.Flag{
cli.StringFlag{
Name: "snapshotter",
Usage: "snapshotter name. Empty value stands for the default value.",
Usage: "Snapshotter name. Empty value stands for the default value.",
EnvVar: "CONTAINERD_SNAPSHOTTER",
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/containers/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

var checkpointCommand = cli.Command{
Name: "checkpoint",
Usage: "checkpoint a container",
Usage: "Checkpoint a container",
ArgsUsage: "CONTAINER REF",
Flags: []cli.Flag{
cli.BoolFlag{
Expand Down
12 changes: 6 additions & 6 deletions cmd/ctr/commands/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
// Command is the cli command for managing containers
var Command = cli.Command{
Name: "containers",
Usage: "manage containers",
Usage: "Manage containers",
Aliases: []string{"c", "container"},
Subcommands: []cli.Command{
createCommand,
Expand All @@ -52,7 +52,7 @@ var Command = cli.Command{

var createCommand = cli.Command{
Name: "create",
Usage: "create container",
Usage: "Create container",
ArgsUsage: "[flags] Image|RootFS CONTAINER [COMMAND] [ARG...]",
SkipArgReorder: true,
Flags: append(append(commands.SnapshotterFlags, []cli.Flag{commands.SnapshotterLabels}...), commands.ContainerFlags...),
Expand Down Expand Up @@ -94,7 +94,7 @@ var createCommand = cli.Command{
var listCommand = cli.Command{
Name: "list",
Aliases: []string{"ls"},
Usage: "list containers",
Usage: "List containers",
ArgsUsage: "[flags] [<filter>, ...]",
Flags: []cli.Flag{
cli.BoolFlag{
Expand Down Expand Up @@ -147,7 +147,7 @@ var listCommand = cli.Command{

var deleteCommand = cli.Command{
Name: "delete",
Usage: "delete one or more existing containers",
Usage: "Delete one or more existing containers",
ArgsUsage: "[flags] CONTAINER [CONTAINER, ...]",
Aliases: []string{"del", "remove", "rm"},
Flags: []cli.Flag{
Expand Down Expand Up @@ -208,7 +208,7 @@ func deleteContainer(ctx context.Context, client *containerd.Client, id string,

var setLabelsCommand = cli.Command{
Name: "label",
Usage: "set and clear labels for a container",
Usage: "Set and clear labels for a container",
ArgsUsage: "[flags] CONTAINER [<key>=<value>, ...]",
Description: "set and clear labels for a container",
Flags: []cli.Flag{},
Expand Down Expand Up @@ -246,7 +246,7 @@ var setLabelsCommand = cli.Command{

var infoCommand = cli.Command{
Name: "info",
Usage: "get info about a container",
Usage: "Get info about a container",
ArgsUsage: "CONTAINER",
Flags: []cli.Flag{
cli.BoolFlag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/containers/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

var restoreCommand = cli.Command{
Name: "restore",
Usage: "restore a container from checkpoint",
Usage: "Restore a container from checkpoint",
ArgsUsage: "CONTAINER REF",
Flags: []cli.Flag{
cli.BoolFlag{
Expand Down
24 changes: 12 additions & 12 deletions cmd/ctr/commands/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var (

getCommand = cli.Command{
Name: "get",
Usage: "get the data for an object",
Usage: "Get the data for an object",
ArgsUsage: "[<digest>, ...]",
Description: "display the image object",
Action: func(context *cli.Context) error {
Expand Down Expand Up @@ -90,7 +90,7 @@ var (

ingestCommand = cli.Command{
Name: "ingest",
Usage: "accept content into the store",
Usage: "Accept content into the store",
ArgsUsage: "[flags] <key>",
Description: "ingest objects into the local content store",
Flags: []cli.Flag{
Expand Down Expand Up @@ -132,13 +132,13 @@ var (

activeIngestCommand = cli.Command{
Name: "active",
Usage: "display active transfers",
Usage: "Display active transfers",
ArgsUsage: "[flags] [<regexp>]",
Description: "display the ongoing transfers",
Flags: []cli.Flag{
cli.DurationFlag{
Name: "timeout, t",
Usage: "total timeout for fetch",
Usage: "Total timeout for fetch",
EnvVar: "CONTAINERD_FETCH_TIMEOUT",
},
cli.StringFlag{
Expand Down Expand Up @@ -175,7 +175,7 @@ var (
listCommand = cli.Command{
Name: "list",
Aliases: []string{"ls"},
Usage: "list all blobs in the store",
Usage: "List all blobs in the store",
ArgsUsage: "[flags]",
Description: "list blobs in the content store",
Flags: []cli.Flag{
Expand Down Expand Up @@ -234,7 +234,7 @@ var (

setLabelsCommand = cli.Command{
Name: "label",
Usage: "add labels to content",
Usage: "Add labels to content",
ArgsUsage: "<digest> [<label>=<value> ...]",
Description: "labels blobs in the content store",
Action: func(context *cli.Context) error {
Expand Down Expand Up @@ -288,7 +288,7 @@ var (

editCommand = cli.Command{
Name: "edit",
Usage: "edit a blob and return a new digest",
Usage: "Edit a blob and return a new digest",
ArgsUsage: "[flags] <digest>",
Description: "edit a blob and return a new digest",
Flags: []cli.Flag{
Expand All @@ -298,7 +298,7 @@ var (
},
cli.StringFlag{
Name: "editor",
Usage: "select editor (vim, emacs, etc.)",
Usage: "Select editor (vim, emacs, etc.)",
EnvVar: "EDITOR",
},
},
Expand Down Expand Up @@ -358,7 +358,7 @@ var (
deleteCommand = cli.Command{
Name: "delete",
Aliases: []string{"del", "remove", "rm"},
Usage: "permanently delete one or more blobs",
Usage: "Permanently delete one or more blobs",
ArgsUsage: "[<digest>, ...]",
Description: `Delete one or more blobs permanently. Successfully deleted
blobs are printed to stdout.`,
Expand Down Expand Up @@ -406,7 +406,7 @@ var (
// needed.
fetchObjectCommand = cli.Command{
Name: "fetch-object",
Usage: "retrieve objects from a remote",
Usage: "Retrieve objects from a remote",
ArgsUsage: "[flags] <remote> <object> [<hint>, ...]",
Description: `Fetch objects by identifier from a remote.`,
Flags: commands.RegistryFlags,
Expand Down Expand Up @@ -448,7 +448,7 @@ var (

fetchBlobCommand = cli.Command{
Name: "fetch-blob",
Usage: "retrieve blobs from a remote",
Usage: "Retrieve blobs from a remote",
ArgsUsage: "[flags] <remote> [<digest>, ...]",
Description: `Fetch blobs by digests from a remote.`,
Flags: commands.RegistryFlags,
Expand Down Expand Up @@ -502,7 +502,7 @@ var (

pushObjectCommand = cli.Command{
Name: "push-object",
Usage: "push an object to a remote",
Usage: "Push an object to a remote",
ArgsUsage: "[flags] <remote> <object> <type>",
Description: `Push objects by identifier to a remote.`,
Flags: commands.RegistryFlags,
Expand Down
4 changes: 2 additions & 2 deletions cmd/ctr/commands/content/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ import (

var fetchCommand = cli.Command{
Name: "fetch",
Usage: "fetch all content for an image into containerd",
Usage: "Fetch all content for an image into containerd",
ArgsUsage: "[flags] <remote> <object>",
Description: `Fetch an image into containerd.
This command ensures that containerd has all the necessary resources to build
an image's rootfs and convert the configuration to a runtime format supported
by containerd.
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
var Command = cli.Command{
Name: "events",
Aliases: []string{"event"},
Usage: "display containerd events",
Usage: "Display containerd events",
Action: func(context *cli.Context) error {
client, ctx, cancel, err := commands.NewClient(context)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/images/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

var convertCommand = cli.Command{
Name: "convert",
Usage: "convert an image",
Usage: "Convert an image",
ArgsUsage: "[flags] <source_ref> <target_ref>",
Description: `Convert an image format.
Expand Down
4 changes: 2 additions & 2 deletions cmd/ctr/commands/images/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

var exportCommand = cli.Command{
Name: "export",
Usage: "export images",
Usage: "Export images",
ArgsUsage: "[flags] <out> <image> ...",
Description: `Export images to an OCI tar archive.
Expand Down Expand Up @@ -64,7 +64,7 @@ When '--all-platforms' is given all images in a manifest list must be available.
},
cli.BoolTFlag{
Name: "local",
Usage: "run export locally rather than through transfer API",
Usage: "Run export locally rather than through transfer API",
},
},
Action: func(context *cli.Context) error {
Expand Down
10 changes: 5 additions & 5 deletions cmd/ctr/commands/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
var Command = cli.Command{
Name: "images",
Aliases: []string{"image", "i"},
Usage: "manage images",
Usage: "Manage images",
Subcommands: cli.Commands{
checkCommand,
exportCommand,
Expand All @@ -59,7 +59,7 @@ var Command = cli.Command{
var listCommand = cli.Command{
Name: "list",
Aliases: []string{"ls"},
Usage: "list images known to containerd",
Usage: "List images known to containerd",
ArgsUsage: "[flags] [<filter>, ...]",
Description: "list images registered with containerd",
Flags: []cli.Flag{
Expand Down Expand Up @@ -142,7 +142,7 @@ var listCommand = cli.Command{

var setLabelsCommand = cli.Command{
Name: "label",
Usage: "set and clear labels for an image",
Usage: "Set and clear labels for an image",
ArgsUsage: "[flags] <name> [<key>=<value>, ...]",
Description: "set and clear labels for an image",
Flags: []cli.Flag{
Expand Down Expand Up @@ -201,7 +201,7 @@ var setLabelsCommand = cli.Command{

var checkCommand = cli.Command{
Name: "check",
Usage: "check existing images to ensure all content is available locally",
Usage: "Check existing images to ensure all content is available locally",
ArgsUsage: "[flags] [<filter>, ...]",
Description: "check existing images to ensure all content is available locally",
Flags: append([]cli.Flag{
Expand Down Expand Up @@ -315,7 +315,7 @@ var checkCommand = cli.Command{
var removeCommand = cli.Command{
Name: "delete",
Aliases: []string{"del", "remove", "rm"},
Usage: "remove one or more images by reference",
Usage: "Remove one or more images by reference",
ArgsUsage: "[flags] <ref> [<ref>, ...]",
Description: "remove one or more images by reference",
Flags: []cli.Flag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/images/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (

var importCommand = cli.Command{
Name: "import",
Usage: "import images",
Usage: "Import images",
ArgsUsage: "[flags] <in>",
Description: `Import images from a tar stream.
Implemented formats:
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/images/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

var mountCommand = cli.Command{
Name: "mount",
Usage: "mount an image to a target path",
Usage: "Mount an image to a target path",
ArgsUsage: "[flags] <ref> <target>",
Description: `Mount an image rootfs to a specified path.
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/images/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (

var pullCommand = cli.Command{
Name: "pull",
Usage: "pull an image from a remote",
Usage: "Pull an image from a remote",
ArgsUsage: "[flags] <ref>",
Description: `Fetch and prepare an image for use in containerd.
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (

var pushCommand = cli.Command{
Name: "push",
Usage: "push an image to a remote",
Usage: "Push an image to a remote",
ArgsUsage: "[flags] <remote> [<local>]",
Description: `Pushes an image reference from containerd.
Expand Down
4 changes: 2 additions & 2 deletions cmd/ctr/commands/images/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

var tagCommand = cli.Command{
Name: "tag",
Usage: "tag an image",
Usage: "Tag an image",
ArgsUsage: "[flags] <source_ref> <target_ref> [<target_ref>, ...]",
Description: `Tag an image for use in containerd.`,
Flags: []cli.Flag{
Expand All @@ -38,7 +38,7 @@ var tagCommand = cli.Command{
},
cli.BoolTFlag{
Name: "local",
Usage: "run tag locally rather than through transfer API",
Usage: "Run tag locally rather than through transfer API",
},
},
Action: func(context *cli.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/images/unmount.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

var unmountCommand = cli.Command{
Name: "unmount",
Usage: "unmount the image from the target",
Usage: "Unmount the image from the target",
ArgsUsage: "[flags] <target>",
Description: "Unmount the image rootfs from the specified target.",
Flags: append(append(commands.RegistryFlags, append(commands.SnapshotterFlags, commands.LabelFlag)...),
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctr/commands/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
// Command to install binary packages
var Command = cli.Command{
Name: "install",
Usage: "install a new package",
Usage: "Install a new package",
ArgsUsage: "<ref>",
Description: "install a new package",
Flags: []cli.Flag{
Expand Down
6 changes: 3 additions & 3 deletions cmd/ctr/commands/leases/leases.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var listCommand = cli.Command{

Name: "list",
Aliases: []string{"ls"},
Usage: "list all active leases",
Usage: "List all active leases",
ArgsUsage: "[flags] <filter>",
Description: "list active leases by containerd",
Flags: []cli.Flag{
Expand Down Expand Up @@ -101,7 +101,7 @@ var listCommand = cli.Command{

var createCommand = cli.Command{
Name: "create",
Usage: "create lease",
Usage: "Create lease",
ArgsUsage: "[flags] <label>=<value> ...",
Description: "create a new lease",
Flags: []cli.Flag{
Expand Down Expand Up @@ -155,7 +155,7 @@ var createCommand = cli.Command{
var deleteCommand = cli.Command{
Name: "delete",
Aliases: []string{"del", "remove", "rm"},
Usage: "delete a lease",
Usage: "Delete a lease",
ArgsUsage: "[flags] <lease id> ...",
Description: "delete a lease",
Flags: []cli.Flag{
Expand Down
Loading

0 comments on commit 0fe3b49

Please sign in to comment.