From 0895dbe93244ede91b975f8a16db1eb63d4b54f2 Mon Sep 17 00:00:00 2001 From: Jess Valarezo Date: Wed, 25 Oct 2017 13:22:53 -0700 Subject: [PATCH] ctr: move content command Signed-off-by: Jess Valarezo --- cmd/ctr/{ => commands/content}/content.go | 60 +++++++++++------------ cmd/ctr/main.go | 3 +- 2 files changed, 31 insertions(+), 32 deletions(-) rename cmd/ctr/{ => commands/content}/content.go (88%) diff --git a/cmd/ctr/content.go b/cmd/ctr/commands/content/content.go similarity index 88% rename from cmd/ctr/content.go rename to cmd/ctr/commands/content/content.go index 63587b1c5..424b81da3 100644 --- a/cmd/ctr/content.go +++ b/cmd/ctr/commands/content/content.go @@ -1,4 +1,4 @@ -package main +package content import ( "fmt" @@ -21,26 +21,26 @@ import ( ) var ( - contentCommand = cli.Command{ + // Command is the cli command for managing content + Command = cli.Command{ Name: "content", Usage: "manage content", Subcommands: cli.Commands{ - listContentCommand, - ingestContentCommand, + listCommand, + ingestCommand, activeIngestCommand, - getContentCommand, - editContentCommand, - deleteContentCommand, - labelContentCommand, + getCommand, + editCommand, + deleteCommand, + setLabelsCommand, }, } - getContentCommand = cli.Command{ + getCommand = cli.Command{ Name: "get", Usage: "get the data for an object", - ArgsUsage: "[flags] [, ...]", - Description: "Display the image object.", - Flags: []cli.Flag{}, + ArgsUsage: "[, ...]", + Description: "display the image object", Action: func(context *cli.Context) error { dgst, err := digest.Parse(context.Args().First()) if err != nil { @@ -63,11 +63,11 @@ var ( }, } - ingestContentCommand = cli.Command{ + ingestCommand = cli.Command{ Name: "ingest", Usage: "accept content into the store", ArgsUsage: "[flags] ", - Description: `Ingest objects into the local content store.`, + Description: "ingest objects into the local content store", Flags: []cli.Flag{ cli.Int64Flag{ Name: "expected-size", @@ -107,9 +107,9 @@ var ( activeIngestCommand = cli.Command{ Name: "active", - Usage: "display active transfers.", + Usage: "display active transfers", ArgsUsage: "[flags] []", - Description: `Display the ongoing transfers.`, + Description: "display the ongoing transfers", Flags: []cli.Flag{ cli.DurationFlag{ Name: "timeout, t", @@ -147,12 +147,12 @@ var ( }, } - listContentCommand = cli.Command{ + listCommand = cli.Command{ Name: "list", Aliases: []string{"ls"}, - Usage: "list all blobs in the store.", - ArgsUsage: "[flags] [, ...]", - Description: `List blobs in the content store.`, + Usage: "list all blobs in the store", + ArgsUsage: "[flags]", + Description: "list blobs in the content store", Flags: []cli.Flag{ cli.BoolFlag{ Name: "quiet, q", @@ -206,12 +206,11 @@ var ( }, } - labelContentCommand = cli.Command{ + setLabelsCommand = cli.Command{ Name: "label", Usage: "add labels to content", - ArgsUsage: "[flags] [