]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
commands: Use consistent style when describing subcommands
authorRohan Hasabe <rohanhasabe8@gmail.com>
Mon, 14 Oct 2024 02:10:38 +0000 (22:10 -0400)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 15 Oct 2024 06:51:53 +0000 (08:51 +0200)
Closes #12897

Change-Id: Ib27a4a7b540d45243e6252db769d4b9fb7447718
Signed-off-by: Rohan Hasabe <rohanhasabe8@gmail.com>
16 files changed:
commands/commandeer.go
commands/config.go
commands/convert.go
commands/deploy.go
commands/env.go
commands/gen.go
commands/import.go
commands/list.go
commands/mod.go
commands/new.go
commands/server.go
testscripts/commands/config.txt
testscripts/commands/convert.txt
testscripts/commands/deploy.txt
testscripts/commands/gen.txt
testscripts/commands/import_jekyll.txt

index 841e8d81cbabc6a2fce33f557368547a294ca921..06565d45d7acaa6f6be99a5110438a9df73d8056 100644 (file)
@@ -509,7 +509,7 @@ func (r *rootCommand) initRootCommand(subCommandName string, cd *simplecobra.Com
                commandName = subCommandName
        }
        cmd.Use = fmt.Sprintf("%s [flags]", commandName)
-       cmd.Short = fmt.Sprintf("%s builds your site", commandName)
+       cmd.Short = "Build your site"
        cmd.Long = `COMMAND_NAME is the main command, used to build your Hugo site.
 
 Hugo is a Fast and Flexible Static Site Generator
index c3d08ae22d4abd15459537b14b655828f692d4f8..b250fc329bfc136faae6154f3af6e997f5060f1b 100644 (file)
@@ -110,8 +110,8 @@ func (c *configCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg
 func (c *configCommand) Init(cd *simplecobra.Commandeer) error {
        c.r = cd.Root.Command.(*rootCommand)
        cmd := cd.CobraCommand
-       cmd.Short = "Print the site configuration"
-       cmd.Long = `Print the site configuration, both default and custom settings.`
+       cmd.Short = "Display site configuration"
+       cmd.Long = `Display site configuration, both default and custom settings.`
        cmd.Flags().StringVar(&c.format, "format", "toml", "preferred file format (toml, yaml or json)")
        _ = cmd.RegisterFlagCompletionFunc("format", cobra.FixedCompletions([]string{"toml", "yaml", "json"}, cobra.ShellCompDirectiveNoFileComp))
        cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for. Defaults to the first language defined.")
index 4e1ceb7d11a0f2729c5cbb0f621b41f38e78eb8c..ebf81cfb3e23a9972473939d7c1ff966d526fc4a 100644 (file)
@@ -105,8 +105,8 @@ func (c *convertCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, ar
 
 func (c *convertCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "Convert your content to different formats"
-       cmd.Long = `Convert your content (e.g. front matter) to different formats.
+       cmd.Short = "Convert front matter to another format"
+       cmd.Long = `Convert front matter to another format.
 
 See convert's subcommands toJSON, toTOML and toYAML for more information.`
 
index 873da14a4a60f412a200e3627cb5ef985d50e472..f0bc670cadfbd01afbb991504339159f7e8a9b88 100644 (file)
@@ -42,8 +42,8 @@ import (
 func newDeployCommand() simplecobra.Commander {
        return &simpleCommand{
                name:  "deploy",
-               short: "Deploy your site to a Cloud provider.",
-               long: `Deploy your site to a Cloud provider.
+               short: "Deploy your site to a cloud provider",
+               long: `Deploy your site to a cloud provider
 
 See https://gohugo.io/hosting-and-deployment/hugo-deploy/ for detailed
 documentation.
index 843fc49d1a95292d44d4dbd46d77415065c88e80..753522560f2d07114d36a49a60f9dec19a214c4e 100644 (file)
@@ -25,8 +25,8 @@ import (
 func newEnvCommand() simplecobra.Commander {
        return &simpleCommand{
                name:  "env",
-               short: "Print Hugo version and environment info",
-               long:  "Print Hugo version and environment info. This is useful in Hugo bug reports",
+               short: "Display version and environment info",
+               long:  "Display version and environment info. This is useful in Hugo bug reports",
                run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
                        r.Printf("%s\n", hugo.BuildVersionString())
                        r.Printf("GOOS=%q\n", runtime.GOOS)
@@ -61,8 +61,8 @@ func newVersionCmd() simplecobra.Commander {
                        r.Println(hugo.BuildVersionString())
                        return nil
                },
-               short: "Print Hugo version and environment info",
-               long:  "Print Hugo version and environment info. This is useful in Hugo bug reports.",
+               short: "Display version",
+               long:  "Display version and environment info. This is useful in Hugo bug reports.",
                withc: func(cmd *cobra.Command, r *rootCommand) {
                        cmd.ValidArgsFunction = cobra.NoFileCompletions
                },
index b6ace80d94dcba5b2a61573377a94bedcc194cb9..83b4d637c66c139aa596572c1c4da39d43d4424f 100644 (file)
@@ -273,7 +273,8 @@ func (c *genCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args [
 
 func (c *genCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "A collection of several useful generators."
+       cmd.Short = "Generate documentation and syntax highlighting styles"
+       cmd.Long = "Generate documentation for your project using Hugo's documentation engine, including syntax highlighting for various programming languages."
 
        cmd.RunE = nil
        return nil
index c2d574aa17c88ba5aef9e1c53db128c11f04a93d..37a6b0dbfe5cb0a60006f938ee20493172ebbdfd 100644 (file)
@@ -90,8 +90,8 @@ func (c *importCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg
 
 func (c *importCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "Import your site from others."
-       cmd.Long = `Import your site from other web site generators like Jekyll.
+       cmd.Short = "Import a site from another system"
+       cmd.Long = `Import a site from another system.
 
 Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`."
 
index c2f9c2d87d18cc946ddd94af9722da639575d32a..f362e22f1afcb05c27b7c25740d5fc83b1473383 100644 (file)
@@ -199,8 +199,8 @@ func (c *listCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args
 
 func (c *listCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "Listing out various types of content"
-       cmd.Long = `Listing out various types of content.
+       cmd.Short = "List content"
+       cmd.Long = `List content.
 
 List requires a subcommand, e.g. hugo list drafts`
 
index a9c8c459d00419c726be5274cdaf1b33927e2ff6..dda7840ccdfc58b1a685eec85eb3660ddae1688f 100644 (file)
@@ -328,7 +328,7 @@ func (c *modCommands) Run(ctx context.Context, cd *simplecobra.Commandeer, args
 
 func (c *modCommands) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "Various Hugo Modules helpers."
+       cmd.Short = "Manage modules"
        cmd.Long = `Various helpers to help manage the modules in your project's dependency graph.
 Most operations here requires a Go version installed on your system (>= Go 1.12) and the relevant VCS client (typically Git).
 This is not needed if you only operate on modules inside /themes or if you have vendored them via "hugo mod vendor".
index f6bb09e0023f935790357c284333918da7cf67f1..901ea02d6159b8855ff98b3f725d37a171efd12c 100644 (file)
@@ -40,7 +40,7 @@ func newNewCommand() *newCommand {
                        &simpleCommand{
                                name:  "content",
                                use:   "content [path]",
-                               short: "Create new content for your site",
+                               short: "Create new content",
                                long: `Create a new content file and automatically set the date and title.
 It will guess which kind of file to create based on the path provided.
 
@@ -181,7 +181,7 @@ func (c *newCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args [
 
 func (c *newCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "Create new content for your site"
+       cmd.Short = "Create new content"
        cmd.Long = `Create a new content file and automatically set the date and title.
 It will guess which kind of file to create based on the path provided.
 
index 680c73a13fced9004a8d98f2b56be0a66cf61d0c..b16bf314883df9afd4eaf53b380e4693feb8e06e 100644 (file)
@@ -508,7 +508,7 @@ func (c *serverCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg
 
 func (c *serverCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
-       cmd.Short = "A high performance webserver"
+       cmd.Short = "Start the embedded web server"
        cmd.Long = `Hugo provides its own webserver which builds and serves the site.
 While hugo server is high performance, it is a webserver with limited options.
 
index b1dba8d1173b167020b3cab4ee5b77deac48f3f2..46386eb9267dadbaf3f5b20280509c26697d7622 100644 (file)
@@ -1,7 +1,7 @@
 # Test the config command.
 
 hugo config -h
-stdout 'Print the site configuration'
+stdout 'Display site configuration'
 
 
 hugo config
index 1cf756215cec91687576e8d6d3cac22d685c2ed6..811aeecc8ac93d45b8f0483c82869d470471fcfb 100644 (file)
@@ -1,7 +1,7 @@
 # Test the convert commands.
 
 hugo convert -h
-stdout 'Convert your content'
+stdout 'Convert front matter to another format'
 hugo convert toJSON -h
 stdout 'to use JSON for the front matter'
 hugo convert toTOML -h
index 0afe1fc44efdbc2623dd2b56f22c5c2e5ae879de..2586f8b8f9a982916b7d76d4e520b3b5a58c4ebc 100644 (file)
@@ -1,7 +1,7 @@
 # Test the deploy command.
 
 hugo deploy -h
-stdout 'Deploy your site to a Cloud provider\.'
+stdout 'Deploy your site to a cloud provider'
 mkdir mybucket
 hugo deploy --target mydeployment --invalidateCDN=false
 grep 'hello' mybucket/index.html
index 16db9fe4a9d15976395019d1ee20e0068d1aad89..b8fe9d2dcbf98c02838c5406a3d50c1c9494dec0 100644 (file)
@@ -3,7 +3,7 @@
 env NUM_COMMANDS=44
 
 hugo gen -h
-stdout 'A collection of several useful generators\.'
+stdout 'Generate documentation for your project using Hugo''s documentation engine, including syntax highlighting for various programming languages\.'
 
 hugo gen doc --dir clidocs
 checkfilecount $NUM_COMMANDS clidocs
index 8d229ba2e25bf4cf3d72ce58ce5dd276bfd6006d..953349acf633bb2b2d30a9827997d60148e8a64e 100644 (file)
@@ -1,7 +1,7 @@
-# Test the import jekyll command.
+# Test the import + import jekyll command.
 
 hugo import -h 
-stdout 'Import your site from other web site generators like Jekyll\.'
+stdout 'Import a site from another system'
 
 hugo import jekyll -h
 stdout 'hugo import from Jekyll\.'