Commit graph

16 commits

Author SHA1 Message Date
vilmibm
3f5893bcb4 fix variable shadowing 2020-07-15 12:36:45 -05:00
vilmibm
cfb8eebf30 quietly return exit code of external command 2020-07-15 11:39:48 -05:00
vilmibm
bbd756a99f split shell alias execution into new function 2020-07-14 16:13:00 -05:00
vilmibm
3a9167cfe4 Implement shell aliases
This command adds --shell to `gh alias set`, allowing specified aliases
to be run through a shell interpreter.
2020-07-14 16:12:07 -05:00
Mislav Marohnić
311536433c The ultimate --help & spelling suggester handler
- short command usage output now lists subcommands instead of flags for
  parent commands

- mistyping a subcommand now results in a non-zero exit status

- requesting `--help` or `-h` for any command now prints help docs on
  stdout and exits with 0
2020-06-16 15:41:46 +02:00
vilmibm
8773a997ee support DEBUG when expanding aliases 2020-06-02 11:26:44 -05:00
vilmibm
2627c5bb74 only process aliases when non-existent command passed 2020-06-02 11:26:44 -05:00
vilmibm
09fa75e141 implement gh alias set 2020-06-02 11:26:44 -05:00
Mislav Marohnić
d8146cd16e Extract cmdutil package 2020-05-20 15:21:31 +02:00
vilmibm
c4693077aa move config stuff to its own package 2020-04-20 13:57:16 -05:00
Mislav Marohnić
79f749a02b Avoid checking for updates during gh completion
This is due to the fact that `gh completion` can be programatically used
during shell startup and we definitely don't want to
1. slow down people's startup time
2. show any upgrade notice until the user has invoked `gh` manually
2020-04-07 16:46:36 +02:00
Mislav Marohnić
9c2efd6c1c Extract reusable IsTerminal() 2020-02-21 12:46:21 +01:00
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Mislav Marohnić
537b0a8429 Friendlier output for network connectivity errors
For `net.DNSError`, the full error message can be scary. Instead, print "error
connecting to HOST" and hint that the user should check their internet connection
or githubstatus.com.

When $DEBUG is set, the full DNS error is printed like before.

Fixes #206
2020-01-23 12:48:10 +01:00
Mislav Marohnić
6282a3c24e Improve readability of error output
Ensure a blank line between error and usage output
2020-01-23 11:00:23 +01:00
Mislav Marohnić
02f5a68937 Move main package to under cmd/
It's a Go convention that main packages (one per each binary produced) are
scoped under `cmd/`.

https://github.com/github/go-lang/blob/master/docs/style-guide.md#directory-structure-and-filenames-layout
2020-01-23 10:45:28 +01:00