Commit graph

10 commits

Author SHA1 Message Date
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