Commit graph

22 commits

Author SHA1 Message Date
Mahmood Ali 76be9b4afb cli: sequence cli.Ui operations
Fixes a bug where if a command flag parsing errors, the resulting error
and help usage messages get interleaved in unexpected and non-user
friendly way.

The reason is that we have flag parsing library effectively writes to
ui.Error in a goroutine.  This is problematic: first, we lose the sequencing between help
usage and error message; second, cli.Ui methods are not concurrent safe.

Here, we introduce a custom error writer that buffers result and calls
ui.Error() in the write method and in the same goroutine.

For context, we need to wrap ui.Error because it's line-oriented, while
flags library expects a io.Writer which is bytes oriented.
2019-12-16 10:08:17 -05:00
Peter McAtominey de133d883f
command: add -tls-server-name flag 2019-09-24 09:20:41 -07:00
Alex Dadgar 742382146e color 2018-03-21 20:27:32 -07:00
Alex Dadgar 4173834231 Enable more linters 2017-09-26 15:26:33 -07:00
Chelsea Holland Komlo e2dc75d853 update comment to use from other commands 2017-09-15 23:33:43 +00:00
Chelsea Holland Komlo e0594a307a fixups from code review 2017-09-15 23:33:43 +00:00
Chelsea Holland Komlo fdf6120987 add acl token as meta flag
add API test for job ACL
2017-09-15 23:33:43 +00:00
Armon Dadgar 08da937cf0 command: Adding acl token create 2017-09-14 21:55:25 -07:00
Alex Dadgar 84d06f6abe Sync namespace changes 2017-09-07 17:04:21 -07:00
Alex Dadgar cf7a3fdf51 Autocomplete global flags 2017-08-23 23:29:29 +00:00
Alex Dadgar 2ee5b6c39d Change tty detection library 2017-08-23 14:35:50 -07:00
Alex Dadgar 3f0fc016e5 Detect STDOUT isn't a TTY and disable color
This PR disables color output when the STDOUT is not a TTY. This makes
running commands under `watch` or other commands nicer.
2017-08-23 14:35:26 -07:00
Diptanu Choudhury eefc8db3b3 Enabling TLS on cli 2016-10-25 10:39:17 -07:00
Alex Dadgar 61fcebf296 initial refactor and cleanup 2016-06-12 11:19:45 -07:00
Alex Dadgar 77dd3af134 docs 2016-06-07 11:33:55 -07:00
Alex Dadgar 86e368cdb8 Add region flag and environment variable 2016-06-07 11:16:04 -07:00
Alex Dadgar 5d6b83fd2e initial implementation of nomad plan 2016-05-17 13:33:48 -07:00
Ivo Verberk 427d3d650d Refactoring of full-id argument and id length constants
* full-id argument is now called verbose to be more future-proof
* constants for identifier length are a little more concise
2016-01-15 23:32:38 +01:00
Ivo Verberk 91a9f2c4ce Shorten CLI identifiers
* Truncate all UUID identifiers to eight characters by default
* Refactor the node identifier to an auto-generated UUID
* Created and updated tests and mocks
2016-01-14 21:57:43 +01:00
Dave York ff2b331192 fixes another typo
- Ui should be UI
2015-09-29 17:16:55 -04:00
Ryan Uber 7b5fd8a214 command: use meta struct for common options 2015-09-14 13:24:03 -07:00
Armon Dadgar 408159d40f Adding basic version command 2015-06-01 15:25:51 +02:00