commands: Use punctuation consistently in short description
This commit is contained in:
parent
fd8b0fbf8a
commit
ee438606dd
5 changed files with 20 additions and 20 deletions
|
@ -149,7 +149,7 @@ url: %s
|
||||||
|
|
||||||
return &simpleCommand{
|
return &simpleCommand{
|
||||||
name: "doc",
|
name: "doc",
|
||||||
short: "Generate Markdown documentation for the Hugo CLI.",
|
short: "Generate Markdown documentation for the Hugo CLI",
|
||||||
long: `Generate Markdown documentation for the Hugo CLI.
|
long: `Generate Markdown documentation for the Hugo CLI.
|
||||||
This command is, mostly, used to create up-to-date documentation
|
This command is, mostly, used to create up-to-date documentation
|
||||||
of Hugo's command-line interface for https://gohugo.io/.
|
of Hugo's command-line interface for https://gohugo.io/.
|
||||||
|
@ -201,7 +201,7 @@ url: %s
|
||||||
newDocsHelper := func() simplecobra.Commander {
|
newDocsHelper := func() simplecobra.Commander {
|
||||||
return &simpleCommand{
|
return &simpleCommand{
|
||||||
name: "docshelper",
|
name: "docshelper",
|
||||||
short: "Generate some data files for the Hugo docs.",
|
short: "Generate some data files for the Hugo docs",
|
||||||
|
|
||||||
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
||||||
r.Println("Generate docs data to", docsHelperTarget)
|
r.Println("Generate docs data to", docsHelperTarget)
|
||||||
|
|
|
@ -44,16 +44,16 @@ func newModCommands() *modCommands {
|
||||||
|
|
||||||
npmCommand := &simpleCommand{
|
npmCommand := &simpleCommand{
|
||||||
name: "npm",
|
name: "npm",
|
||||||
short: "Various npm helpers.",
|
short: "Various npm helpers",
|
||||||
long: `Various npm (Node package manager) helpers.`,
|
long: `Various npm (Node package manager) helpers.`,
|
||||||
commands: []simplecobra.Commander{
|
commands: []simplecobra.Commander{
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "pack",
|
name: "pack",
|
||||||
short: "Experimental: Prepares and writes a composite package.json file for your project.",
|
short: "Experimental: Prepares and writes a composite package.json file for your project",
|
||||||
long: `Prepares and writes a composite package.json file for your project.
|
long: `Prepares and writes a composite package.json file for your project.
|
||||||
|
|
||||||
On first run it creates a "package.hugo.json" in the project root if not already there. This file will be used as a template file
|
On first run it creates a "package.hugo.json" in the project root if not already there. This file will be used as a template file
|
||||||
with the base dependency set.
|
with the base dependency set.
|
||||||
|
|
||||||
This set will be merged with all "package.hugo.json" files found in the dependency tree, picking the version closest to the project.
|
This set will be merged with all "package.hugo.json" files found in the dependency tree, picking the version closest to the project.
|
||||||
|
|
||||||
|
@ -80,12 +80,12 @@ so this may/will change in future versions of Hugo.
|
||||||
commands: []simplecobra.Commander{
|
commands: []simplecobra.Commander{
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "init",
|
name: "init",
|
||||||
short: "Initialize this project as a Hugo Module.",
|
short: "Initialize this project as a Hugo Module",
|
||||||
long: `Initialize this project as a Hugo Module.
|
long: `Initialize this project as a Hugo Module.
|
||||||
It will try to guess the module path, but you may help by passing it as an argument, e.g:
|
It will try to guess the module path, but you may help by passing it as an argument, e.g:
|
||||||
|
|
||||||
hugo mod init github.com/gohugoio/testshortcodes
|
hugo mod init github.com/gohugoio/testshortcodes
|
||||||
|
|
||||||
Note that Hugo Modules supports multi-module projects, so you can initialize a Hugo Module
|
Note that Hugo Modules supports multi-module projects, so you can initialize a Hugo Module
|
||||||
inside a subfolder on GitHub, as one example.
|
inside a subfolder on GitHub, as one example.
|
||||||
`,
|
`,
|
||||||
|
@ -111,7 +111,7 @@ so this may/will change in future versions of Hugo.
|
||||||
},
|
},
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "verify",
|
name: "verify",
|
||||||
short: "Verify dependencies.",
|
short: "Verify dependencies",
|
||||||
long: `Verify checks that the dependencies of the current module, which are stored in a local downloaded source cache, have not been modified since being downloaded.`,
|
long: `Verify checks that the dependencies of the current module, which are stored in a local downloaded source cache, have not been modified since being downloaded.`,
|
||||||
withc: func(cmd *cobra.Command, r *rootCommand) {
|
withc: func(cmd *cobra.Command, r *rootCommand) {
|
||||||
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
||||||
|
@ -129,7 +129,7 @@ so this may/will change in future versions of Hugo.
|
||||||
},
|
},
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "graph",
|
name: "graph",
|
||||||
short: "Print a module dependency graph.",
|
short: "Print a module dependency graph",
|
||||||
long: `Print a module dependency graph with information about module status (disabled, vendored).
|
long: `Print a module dependency graph with information about module status (disabled, vendored).
|
||||||
Note that for vendored modules, that is the version listed and not the one from go.mod.
|
Note that for vendored modules, that is the version listed and not the one from go.mod.
|
||||||
`,
|
`,
|
||||||
|
@ -149,7 +149,7 @@ Note that for vendored modules, that is the version listed and not the one from
|
||||||
},
|
},
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "clean",
|
name: "clean",
|
||||||
short: "Delete the Hugo Module cache for the current project.",
|
short: "Delete the Hugo Module cache for the current project",
|
||||||
long: `Delete the Hugo Module cache for the current project.`,
|
long: `Delete the Hugo Module cache for the current project.`,
|
||||||
withc: func(cmd *cobra.Command, r *rootCommand) {
|
withc: func(cmd *cobra.Command, r *rootCommand) {
|
||||||
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
||||||
|
@ -175,7 +175,7 @@ Note that for vendored modules, that is the version listed and not the one from
|
||||||
},
|
},
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "tidy",
|
name: "tidy",
|
||||||
short: "Remove unused entries in go.mod and go.sum.",
|
short: "Remove unused entries in go.mod and go.sum",
|
||||||
withc: func(cmd *cobra.Command, r *rootCommand) {
|
withc: func(cmd *cobra.Command, r *rootCommand) {
|
||||||
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
cmd.ValidArgsFunction = cobra.NoFileCompletions
|
||||||
applyLocalFlagsBuildConfig(cmd, r)
|
applyLocalFlagsBuildConfig(cmd, r)
|
||||||
|
@ -190,7 +190,7 @@ Note that for vendored modules, that is the version listed and not the one from
|
||||||
},
|
},
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "vendor",
|
name: "vendor",
|
||||||
short: "Vendor all module dependencies into the _vendor directory.",
|
short: "Vendor all module dependencies into the _vendor directory",
|
||||||
long: `Vendor all module dependencies into the _vendor directory.
|
long: `Vendor all module dependencies into the _vendor directory.
|
||||||
If a module is vendored, that is where Hugo will look for it's dependencies.
|
If a module is vendored, that is where Hugo will look for it's dependencies.
|
||||||
`,
|
`,
|
||||||
|
@ -209,16 +209,16 @@ Note that for vendored modules, that is the version listed and not the one from
|
||||||
|
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "get",
|
name: "get",
|
||||||
short: "Resolves dependencies in your current Hugo Project.",
|
short: "Resolves dependencies in your current Hugo project",
|
||||||
long: `
|
long: `
|
||||||
Resolves dependencies in your current Hugo Project.
|
Resolves dependencies in your current Hugo project.
|
||||||
|
|
||||||
Some examples:
|
Some examples:
|
||||||
|
|
||||||
Install the latest version possible for a given module:
|
Install the latest version possible for a given module:
|
||||||
|
|
||||||
hugo mod get github.com/gohugoio/testshortcodes
|
hugo mod get github.com/gohugoio/testshortcodes
|
||||||
|
|
||||||
Install a specific version:
|
Install a specific version:
|
||||||
|
|
||||||
hugo mod get github.com/gohugoio/testshortcodes@v0.3.0
|
hugo mod get github.com/gohugoio/testshortcodes@v0.3.0
|
||||||
|
|
|
@ -32,7 +32,7 @@ func newReleaseCommand() simplecobra.Commander {
|
||||||
|
|
||||||
return &simpleCommand{
|
return &simpleCommand{
|
||||||
name: "release",
|
name: "release",
|
||||||
short: "Release a new version of Hugo.",
|
short: "Release a new version of Hugo",
|
||||||
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
||||||
rel, err := releaser.New(skipPush, try, step)
|
rel, err := releaser.New(skipPush, try, step)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -119,7 +119,7 @@ func newServerCommand() *serverCommand {
|
||||||
commands: []simplecobra.Commander{
|
commands: []simplecobra.Commander{
|
||||||
&simpleCommand{
|
&simpleCommand{
|
||||||
name: "trust",
|
name: "trust",
|
||||||
short: "Install the local CA in the system trust store.",
|
short: "Install the local CA in the system trust store",
|
||||||
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
||||||
action := "-install"
|
action := "-install"
|
||||||
if uninstall {
|
if uninstall {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# The hugo mod get command handles flags a little special, but the -h flag should print the help.
|
# The hugo mod get command handles flags a little special, but the -h flag should print the help.
|
||||||
hugo mod get -h
|
hugo mod get -h
|
||||||
stdout 'Resolves dependencies in your current Hugo Project'
|
stdout 'Resolves dependencies in your current Hugo project'
|
||||||
|
|
||||||
# Invalid flag. Should print an error message to stderr and the help to stdout.
|
# Invalid flag. Should print an error message to stderr and the help to stdout.
|
||||||
! hugo --asdf
|
! hugo --asdf
|
||||||
|
@ -15,4 +15,4 @@ stdout 'hugo is the main command'
|
||||||
stderr 'failed to load config'
|
stderr 'failed to load config'
|
||||||
|
|
||||||
-- hugo.toml --
|
-- hugo.toml --
|
||||||
invalid: toml
|
invalid: toml
|
||||||
|
|
Loading…
Add table
Reference in a new issue