Commit graph

19 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
c8f45d1d86
commands: Fix autocomplete docs 2021-02-20 14:08:51 +01:00
Anthony Fok
5f621df257
commands: Add PowerShell completion support
Revert "Refactor: Remove powershell support" with fixes

Thanks to Ben Mezger (@benmezger) for the original code.
See #8122

This reverts commit a7c515e1b5.
2021-02-09 13:37:36 -07:00
Ben Mezger
d36fd5b3ee Refactor: Write to stdout by default 2021-02-04 15:32:51 -07:00
Ben Mezger
a7c515e1b5 Refactor: Remove powershell support 2021-02-04 15:32:51 -07:00
Ben Mezger
216b00f358 Feat: Add zsh, fish and powershell completion support
See issue #4296
2021-02-04 15:32:51 -07:00
Bjørn Erik Pedersen
d90e37e0c6 all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
2020-12-03 13:12:58 +01:00
Bjørn Erik Pedersen
4d32f2fa89
commands: Make the hugo command non-global
See #4598
2018-04-11 09:50:19 +02:00
Bjørn Erik Pedersen
e0621d207c
commands: Make the gen commands non-global
See #4598
2018-04-11 09:50:18 +02:00
Albert Nigmatzianov
f0f69d03c5 commands: Make first letter of flags' usage lowercase 2017-04-26 22:23:20 +02:00
Bjørn Erik Pedersen
1accd3ba88 Fix example for autocomplete
See #2235
2016-06-22 13:59:53 +02:00
Bjørn Erik Pedersen
9cf93e11f8 commands: Fix remaining Golint warning 2016-03-23 00:06:10 +01:00
Anthony Fok
8509727fe8 Add copyright header to that source files that don’t have one.
See #1646
2015-12-10 15:19:38 -07:00
Bjørn Erik Pedersen
3f0f7eed68 Improve error handling in commands
Cobra, the CLI commander in use in Hugo, has some long awaited improvements in the error handling department.
This enables a more centralized error handling approach.

This commit introduces that by changing all the command funcs to `RunE`:

* The core part of the error logging, usage logging and `os.Exit(-1)` is now performed in one place and that one place only.
* The usage text is now only shown on invalid arguments etc. (user errors)

Fixes #1502
2015-12-02 07:07:05 -07:00
Anthony Fok
666ddd2377 Enable dirname and filename completion for more flags
These flags are:

 * --source (-s), --cacheDir, --destination (-d) and --logFile
 * --completionfile and --dir.
2015-12-02 02:24:49 -07:00
Bjørn Erik Pedersen
3d09de8910 Restructure the gen commands
Fixes #1603
2015-11-23 16:51:12 +01:00
Anthony Fok
7555e364d0 Print feedback for hugo genautocomplete 2015-08-09 17:59:44 +02:00
Anthony Fok
f2ab0b2608 Improve formatting of Hugo command descriptions
Trying to make them look good both in the terminal (`hugo help [command]`)
and in the web browser (http://gohugo.io/commands/).  :-)
2015-08-04 03:19:57 -06:00
bep
befa26b152 Remove trailing spaces in completionfile flag 2015-05-16 19:52:09 +02:00
bep
be9224d720 Add Bash completion
Add a new command, genautocomplete, wich generates a Bash completion script (zsh and others later).

The script is by default written to `/etc/bash_completion.d/hugo.sh`; this can be set in `--completionfile=/some/file`.

Fixes #438
2015-05-16 18:04:59 +02:00