diff options
author | Martin Treusch von Buttlar <martin.tvb@vitraum.de> | 2017-05-17 07:19:05 +0200 |
---|---|---|
committer | Martin Treusch von Buttlar <martin.tvb@vitraum.de> | 2017-05-17 07:19:05 +0200 |
commit | 99bae528846f2fb900ff1168c1e143181f89e597 (patch) | |
tree | 9a21c49f095eb33c28a45fbaa6a20db1f401434c | |
parent | fa6a4907557b79f2da6835074233bec717725105 (diff) |
add shorthand commands for add, generate, serve and version
-rw-r--r-- | cmd/ponzu/add.go | 5 | ||||
-rw-r--r-- | cmd/ponzu/generate.go | 10 | ||||
-rw-r--r-- | cmd/ponzu/main.go | 7 | ||||
-rw-r--r-- | cmd/ponzu/usage.go | 5 |
4 files changed, 16 insertions, 11 deletions
diff --git a/cmd/ponzu/add.go b/cmd/ponzu/add.go index 7832b4e..533c171 100644 --- a/cmd/ponzu/add.go +++ b/cmd/ponzu/add.go @@ -13,8 +13,9 @@ import ( ) var addCmd = &cobra.Command{ - Use: "add <repo>", - Short: "Downloads addon from specified import path", + Use: "add <repo>", + Aliases: []string{"a"}, + Short: "Downloads addon from specified import path", Long: `Downloads addon from specified import path to $GOPATH/src and copys it to the current project's ./addons directory. Must be called from within a Ponzu project directory.`, diff --git a/cmd/ponzu/generate.go b/cmd/ponzu/generate.go index fd3b77e..048addd 100644 --- a/cmd/ponzu/generate.go +++ b/cmd/ponzu/generate.go @@ -417,8 +417,9 @@ func generateContentType(args []string) error { } var generateCmd = &cobra.Command{ - Use: "generate <generator type (,...fields)>", - Short: "generate boilerplate code for various Ponzu components", + Use: "generate <generator type (,...fields)>", + Aliases: []string{"gen", "g"}, + Short: "generate boilerplate code for various Ponzu components", Long: `Generate boilerplate code for various Ponzu components, such as 'content'. The command above will generate a file 'content/review.go' with boilerplate @@ -439,8 +440,9 @@ generate commands return nothing.`, } var contentCmd = &cobra.Command{ - Use: "content <namespace> <field> <field>...", - Short: "generates a new content type", + Use: "content <namespace> <field> <field>...", + Aliases: []string{"c"}, + Short: "generates a new content type", RunE: func(cmd *cobra.Command, args []string) error { return generateContentType(args) }, diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go index bfe501a..6d5afd2 100644 --- a/cmd/ponzu/main.go +++ b/cmd/ponzu/main.go @@ -113,9 +113,10 @@ var ErrWrongOrMissingService = errors.New("To execute 'ponzu serve', " + "you must specify which service to run.") var serveCmd = &cobra.Command{ - Use: "serve <service,service>", - Short: "actually run the server", - Hidden: true, + Use: "serve <service,service>", + Aliases: []string{"s"}, + Short: "actually run the server", + Hidden: true, RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return ErrWrongOrMissingService diff --git a/cmd/ponzu/usage.go b/cmd/ponzu/usage.go index f5160b2..3046be7 100644 --- a/cmd/ponzu/usage.go +++ b/cmd/ponzu/usage.go @@ -11,8 +11,9 @@ import ( ) var versionCmd = &cobra.Command{ - Use: "version", - Short: "Prints the version of Ponzu your project is using.", + Use: "version", + Aliases: []string{"v"}, + Short: "Prints the version of Ponzu your project is using.", Long: `Prints the version of Ponzu your project is using. Must be called from within a Ponzu project directory.`, Example: `$ ponzu version |