Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI UX: Flags shouldn't be global #1624

Closed
joneskoo opened this issue Nov 26, 2015 · 2 comments · Fixed by #1652
Closed

CLI UX: Flags shouldn't be global #1624

joneskoo opened this issue Nov 26, 2015 · 2 comments · Fixed by #1652
Assignees
Milestone

Comments

@joneskoo
Copy link

Command line flags should not be global. This is obvious when you look at for example the help for "gen man"; the options don't make sense with that command.

$ hugo gen man --help
This command automatically generates up-to-date man pages of Hugo's
command-line interface.  By default, it creates the man page files
in the "man" directory under the current directory.

Usage:
  hugo gen man [flags]

Global Flags:
  -b, --baseURL="": hostname (and path) to the root, e.g. http://spf13.com/
  -D, --buildDrafts[=false]: include content marked as draft
  -F, --buildFuture[=false]: include content with publishdate in the future
      --cacheDir="": filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
      --canonifyURLs[=false]: if true, all relative URLs will be canonicalized using baseURL
      --config="": config file (default is path/config.yaml|json|toml)
  -d, --destination="": filesystem path to write files to
      --disableRSS[=false]: Do not build RSS files
      --disableSitemap[=false]: Do not build Sitemap file
      --editor="": edit new content with this editor, if provided
      --ignoreCache[=false]: Ignores the cache directory for reading but still writes to it
      --log[=false]: Enable Logging
      --logFile="": Log File path (if set, logging enabled automatically)
      --pluralizeListTitles[=true]: Pluralize titles in lists using inflect
      --preserveTaxonomyNames[=false]: Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")
  -s, --source="": filesystem path to read files relative from
      --stepAnalysis[=false]: display memory and timing of different steps of the program
  -t, --theme="": theme to use (located in /themes/THEMENAME/)
      --uglyURLs[=false]: if true, use /filename.html instead of /filename/
  -v, --verbose[=false]: verbose output
      --verboseLog[=false]: verbose logging
@spf13
Copy link
Contributor

spf13 commented Nov 28, 2015

This is a good request. Originally hugo only had two commands, hugo and hugo server. Since they shared a lot of flags it made sense to make it global (then). Now with a lot of other sub commands we should create them separately on server and root.

@anthonyfok anthonyfok added this to the v0.16 milestone Dec 1, 2015
@anthonyfok anthonyfok self-assigned this Dec 1, 2015
anthonyfok added a commit to anthonyfok/hugo that referenced this issue Dec 3, 2015
This is to ensure that only the relevant command-line flags
for a certain Hugo subcommand is shown to the end user,
reducing clutter and improving user experience.

Fixes gohugoio#1624 - CLI UX: Flags shouldn't be global
anthonyfok added a commit that referenced this issue Dec 3, 2015
The crash was introduced by commit 00d0477 in PR #1652
where access to NoTimes was attempted even though --noTimes
was not defined for the config, check and benchmark commands.

Special thanks to @bep for the heads-up!

See also #1624 - CLI UX: Flags shouldn't be global
anthonyfok added a commit that referenced this issue Dec 11, 2015
anthonyfok added a commit that referenced this issue Dec 16, 2015
v0.15 had it, but I removed it inadvertently for 0.16-DEV
in commit 00d0477 in PR #1652.

Also add directory bash-completion for `--source`
for `hugo convert`, `hugo list` and `hugo new`.

See #1624, #1589
anthonyfok added a commit that referenced this issue Dec 16, 2015
Reason: The `--source` flag was added back to the `hugo new` commands
in commit c1e134f.

See #1624, #1589
bramp pushed a commit to bramp/hugo that referenced this issue Dec 17, 2015
This is to ensure that only the relevant command-line flags
for a certain Hugo subcommand is shown to the end user,
reducing clutter and improving user experience.

Fixes gohugoio#1624 - CLI UX: Flags shouldn't be global
bramp pushed a commit to bramp/hugo that referenced this issue Dec 17, 2015
The crash was introduced by commit 00d0477 in PR gohugoio#1652
where access to NoTimes was attempted even though --noTimes
was not defined for the config, check and benchmark commands.

Special thanks to @bep for the heads-up!

See also gohugoio#1624 - CLI UX: Flags shouldn't be global
bramp pushed a commit to bramp/hugo that referenced this issue Dec 17, 2015
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
This is to ensure that only the relevant command-line flags
for a certain Hugo subcommand is shown to the end user,
reducing clutter and improving user experience.

Fixes gohugoio#1624 - CLI UX: Flags shouldn't be global
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
The crash was introduced by commit 00d0477 in PR gohugoio#1652
where access to NoTimes was attempted even though --noTimes
was not defined for the config, check and benchmark commands.

Special thanks to @bep for the heads-up!

See also gohugoio#1624 - CLI UX: Flags shouldn't be global
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
v0.15 had it, but I removed it inadvertently for 0.16-DEV
in commit 00d0477 in PR gohugoio#1652.

Also add directory bash-completion for `--source`
for `hugo convert`, `hugo list` and `hugo new`.

See gohugoio#1624, gohugoio#1589
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
Reason: The `--source` flag was added back to the `hugo new` commands
in commit c1e134f.

See gohugoio#1624, gohugoio#1589
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants