Commit graph

140 commits

Author SHA1 Message Date
Mislav Marohnić
32e36d2fe0 Merge branch 'master' into exec-cmd-error-info 2019-11-06 19:36:12 +01:00
Mislav Marohnić
cdd495160c Merge pull request #39 from github/completion
Add `completion` script
2019-11-06 19:31:29 +01:00
Corey Johnson
da334e283b Merge pull request #43 from github/gh-issue
Add `gh issue list` and `gh issue view`
2019-11-06 10:09:11 -08:00
Corey Johnson
3782ed6c8d Tweaks 2019-11-06 10:07:24 -08:00
Corey Johnson
738562436f Update tests 2019-11-06 10:02:35 -08:00
Corey Johnson
b50898f05b move to init 2019-11-06 10:01:16 -08:00
Nate Smith
9ad41cf31f Merge pull request #48 from github/colors
Switch to mgutz/ansi
2019-11-06 10:22:18 -07:00
nate smith
e8634ca5d8 use mgutz/ansi in utils 2019-11-05 13:47:48 -07:00
Mislav Marohnić
531db42c47 Log executed git commands when DEBUG is active 2019-11-01 23:20:45 +01:00
Mislav Marohnić
8ee97d72cd Extract outputStub into testing.go 2019-11-01 23:20:15 +01:00
Mislav Marohnić
f6fcdf114e Use SetPrepareCmd hook to spy on OpenInBrowser
We are now able to assert that the browse command was called with the correct URL
2019-11-01 22:18:12 +01:00
Mislav Marohnić
d881a2e52e Ensure git operations preserve their stderr in error output
This also provides a SetPrepareCmd hook for tests to be able to define stubs for commands that are supposed to be run
2019-11-01 22:16:23 +01:00
Mislav Marohnić
875352a03c Fix issues order 2019-11-01 14:36:26 +01:00
Mislav Marohnić
4f03370aa5 Add tests 2019-10-31 23:43:50 +01:00
Mislav Marohnić
55e9c18840 Merge remote-tracking branch 'origin/master' into completion 2019-10-31 23:28:06 +01:00
Mislav Marohnić
a66aaafb19 Merge pull request #40 from github/version-flag
Add `--version` flag support
2019-10-31 23:13:26 +01:00
Mislav Marohnić
2939924124 Merge branch 'master' into version-flag 2019-10-31 23:13:07 +01:00
Mislav Marohnić
c3d70bd8cd Clarify where Version and BuildDate are set 2019-10-31 23:10:42 +01:00
Mislav Marohnić
f0ca9aa023 Merge pull request #41 from github/silence-usage
Silence Cobra usage on errors
2019-10-31 22:56:02 +01:00
Mislav Marohnić
e87775845d Also print cmd usage string on "unknown command" 2019-10-31 22:44:43 +01:00
Corey Johnson
cf1feb847e Add gh issue list and gh issue view ISSUE_NUMBER 2019-10-31 11:02:27 -07:00
Mislav Marohnić
faa96be9ea Ensure that errors are printed to stderr 2019-10-31 15:46:38 +01:00
Mislav Marohnić
a6e61a3a8d Silence Cobra usage on errors
When an error occurs anywhere in a command, Cobra used to print the
error itself and command usage help.

We already print error in `main()`, and we don't want to use command
usage string on anything other than flag-parsing errors.

This also fixes the double output of each error.
2019-10-31 13:47:10 +01:00
Mislav Marohnić
0bf3e7500c Add --version flag support 2019-10-31 12:14:55 +01:00
Mislav Marohnić
d9ef40c873 Add completion script 2019-10-31 11:41:24 +01:00
Corey Johnson
357de1b183 Add Issue query 2019-10-30 16:26:33 -07:00
Corey Johnson
eefb6d13ee Merge pull request #34 from github/no-global
Eliminate package-level global state
2019-10-29 17:18:03 -07:00
Mislav Marohnić
862db45587 Add mising files 2019-10-29 21:19:34 +01:00
Mislav Marohnić
51b08f871e Merge pull request #37 from github/remove-readme-redirect
Remove redirect to helper-cli from the README
2019-10-29 21:18:27 +01:00
Mislav Marohnić
343ccaf0cb Merge remote-tracking branch 'origin/master' into no-global 2019-10-29 21:17:14 +01:00
Mislav Marohnić
39a6feba9c Now able to use api in oauth flow 2019-10-29 21:16:35 +01:00
Mislav Marohnić
f786802e9e Customizable API client 2019-10-29 21:07:03 +01:00
Julian Nadeau
642276faf8 Remove redirect to helper-cli from the README 2019-10-29 13:43:47 -04:00
Mislav Marohnić
e7159254b4 Merge pull request #31 from github/stop-vendor
Stop requiring vendored dependencies in CI
2019-10-28 15:05:01 +01:00
Mislav Marohnić
8370602f49 WIP eliminate package-level state in commands, context 2019-10-25 21:49:08 +02:00
Mislav Marohnić
641de86427 Eliminate package-level state in git remote parsing 2019-10-25 21:48:25 +02:00
Corey Johnson
07322341f8 Merge pull request #32 from github/update-readme
Update the README.md
2019-10-24 15:29:47 -07:00
Corey Johnson
c46f4d94ce Update README.md 2019-10-23 14:18:06 -07:00
Mislav Marohnić
6d8af20e30 Stop requiring vendored dependencies in CI
We started vendoring dependencies because this was a practice that the Go community had for a while now to:

1. Speed up builds - no need to fetch dependencies every time;
2. Guard against 3rd-party downtime - CI passes even if hosts such as `gopkg.in` are down, or if someone deletes their GitHub repo/account hosting a particular module.

With Go 1.13 and GitHub Actions, however, we have these problems solved for free:
- The built-in goproxy caches dependencies and speeds up downloads;
- Octofactory ensures that dependencies are cached on our own infrastructure, guarding us from 3rd-party downtime.

With all this in mind, I feel that we don't have to require vendoring dependencies anymore.
2019-10-23 22:35:11 +02:00
Nate Smith
24ebdc23b5 Merge pull request #27 from github/fix-repo-branch-flags
Fix global `--repo`, `--current-branch` functionality
2019-10-21 13:38:14 -05:00
Nate Smith
398bd27d02 Merge pull request #6 from github/oauth
OAuth authentication flow
2019-10-18 15:01:39 -05:00
Mislav Marohnić
c82e38353f Fix global --repo, --current-branch functionality
Turns out I've tried to use the flags' value too early: they are not yet
parsed out at package `init()` time.
2019-10-18 19:24:16 +02:00
Mislav Marohnić
5aca575964 Wire up OAuth authentication flow to initialize config file
The config file is now `~/.config/gh`.
2019-10-18 19:08:11 +02:00
Mislav Marohnić
2aa77fb8ea Add Context.SetAuthToken 2019-10-18 18:47:42 +02:00
Mislav Marohnić
de85294c79 Extract OAuth logic into a struct 2019-10-18 15:44:46 +02:00
Mislav Marohnić
7bf306f022 Generate and verify random "state" value
This is for extra security during OAuth flow.
2019-10-18 15:44:46 +02:00
Mislav Marohnić
216ffb89e2 Use random available port number 2019-10-18 15:44:46 +02:00
Mislav Marohnić
db0084f623 One weird trick to prevent macOS firewall popup
Discovered by a stay-at-home developer!
2019-10-18 15:44:46 +02:00
Mislav Marohnić
d90552454d Preliminary OAuth flow 2019-10-18 15:44:44 +02:00
Corey Johnson
e2767b463c Merge pull request #25 from github/pr-view-tests
Add tests for `gh pr view`
2019-10-17 10:48:09 -07:00