Corey Johnson
7d7a010739
Clear out usage func
2020-06-10 09:43:24 -07:00
Corey Johnson
4931892cc3
Apply changes that were lost in merge conflict
2020-06-10 09:30:35 -07:00
Corey Johnson
56f1315d5f
Merge remote-tracking branch 'origin/trunk' into h-e-l-p
2020-06-10 09:28:40 -07:00
Corey Johnson
a6948423f4
Update issue and pr help
2020-06-09 09:33:22 -07:00
Corey Johnson
51353c79d6
Use cobra Example field
2020-06-09 08:43:22 -07:00
Nate Smith
28f91cbed8
Merge pull request #1107 from vilmibm/move-credits
...
minor credits polish
2020-06-08 15:17:52 -05:00
vilmibm
e2ef712e43
use Command.Hidden
2020-06-08 12:31:40 -05:00
Mislav Marohnić
f976056126
Merge pull request #1109 from gedenata/remove-strict-link
...
remove strict ">" when click link
Closes #1126
2020-06-08 13:56:07 +02:00
vilmibm
8963d80942
better get func
2020-06-05 13:09:04 -05:00
gedenata
61e0a6c68f
remove strict when click link
2020-06-05 12:34:33 +08:00
vilmibm
bd4bac962a
use Annotations to hide commands
2020-06-04 16:42:32 -05:00
Corey Johnson
4d182c4314
Better help command
2020-06-04 12:51:26 -07:00
Mislav Marohnić
1f616859fc
Merge remote-tracking branch 'origin' into auth-split
2020-06-04 12:00:19 +02:00
vilmibm
7014145a81
linter appeasement
2020-06-03 15:05:44 -05:00
vilmibm
a3a6f25024
do not use string concatenation for extra args
2020-06-02 16:07:24 -05:00
vilmibm
e37b517211
better placeholder handling
2020-06-02 11:26:44 -05:00
vilmibm
bace327634
pass rest of args through
2020-06-02 11:26:44 -05:00
vilmibm
f84707b5b1
args length check; needs test
2020-06-02 11:26:44 -05:00
vilmibm
09fa75e141
implement gh alias set
2020-06-02 11:26:44 -05:00
Mislav Marohnić
77227a6c50
Trigger OAuth flow only when requesting auth token
...
Previously we would trigger OAuth flow when the config file did not
exist. Now we will let an empty Config object be initialized in that
case, but trigger OAuth flow when the Context caller requests an
AuthToken.
2020-06-02 13:24:39 +02:00
Mislav Marohnić
eab5af9449
Merge remote-tracking branch 'origin' into cobra1.0
2020-05-28 15:15:20 +02:00
Mislav Marohnić
13ba0aa56e
Respect GITHUB_TOKEN in api command
2020-05-27 13:09:05 +02:00
Mislav Marohnić
2e93a065b1
Merge remote-tracking branch 'origin/master' into api-command
2020-05-27 12:56:06 +02:00
Mislav Marohnić
c6643821dc
Don't offer to reauthenticate for gist if GITHUB_TOKEN is used
2020-05-27 11:57:03 +02:00
Mislav Marohnić
ab0e43c6c8
Merge remote-tracking branch 'origin/master' into auth-from-env
2020-05-27 11:44:19 +02:00
Mislav Marohnić
108f7bd66c
Dirty workaround to display helpful error message on mistyped subcommands
...
When executing `gh pr re` (note the incomplete command name), Cobra
would just display the help text for `gh pr` on standard output, exit
with status 0, and not print any message that you have mistyped the
"re" subcommand. Each part of this behavior is wrong.
This workaround makes sure that the helpful error message is printed on
stderr:
$ gh pr re
unknown command "re" for "gh pr"
Did you mean this?
reopen
ready
review
However, the exit status is still 0, whereas it should be non-zero.
Since `HelpFunc` does not return an error argument, we cannot trigger an
error status from this workaround.
2020-05-22 19:02:34 +02:00
vilmibm
509be34af6
Merge remote-tracking branch 'origin/master' into wingkwong/master
2020-05-20 17:08:31 -05:00
Mislav Marohnić
db9014fd7f
Respect auth token from GITHUB_TOKEN environment variable
...
If GITHUB_TOKEN is non-blank, it overrides authentication info found in
the config file. The config file is, in fact, never consulted.
2020-05-20 17:35:10 +02:00
Mislav Marohnić
bef62faaea
Make NewCmdApi testable
2020-05-20 15:21:35 +02:00
Mislav Marohnić
d8146cd16e
Extract cmdutil package
2020-05-20 15:21:31 +02:00
Mislav Marohnić
90fa193eaf
Promote api command to a pkg/cmd/api package
2020-05-20 15:21:31 +02:00
Mislav Marohnić
4d11732a47
Merge pull request #943 from cli/reauth-bug
...
pass apiClient to determineBaseRepo
2020-05-18 13:16:07 +02:00
Kevin Bluer
d440a95aed
Improved error message when "owner/repo" format not provided ( #919 )
...
Fixes #882
2020-05-18 11:13:48 +02:00
vilmibm
780875d645
fix tests
2020-05-15 16:47:11 -05:00
vilmibm
96ba1eacef
undo initial thing
2020-05-15 16:44:51 -05:00
vilmibm
bf05975ceb
Revert "small repo fix"
...
This reverts commit 08e9cdaee1 .
2020-05-15 16:40:47 -05:00
vilmibm
7decae71fc
untested first pass on ensureScopes
2020-05-15 16:40:13 -05:00
vilmibm
c8c807b954
pass apiClient to determineBaseRepo
...
Our code had an unspoken assumption that only one apiClient is created
during the course of a command. Violating this assumption is fine in
almost all cases, but not when we need to do a re-auth to add a new
oauth scope to a user's token.
There is likely a more elegant solution to the problem but until then
this changes determineBaseRepo to use an existing apiClient.
2020-05-15 15:29:33 -05:00
vilmibm
08e9cdaee1
small repo fix
2020-05-15 10:25:40 -05:00
vilmibm
3b62d79e81
notes
2020-05-15 09:52:06 -05:00
vilmibm
a62f2987c0
stray debug
2020-05-13 14:59:14 -05:00
vilmibm
cc1ffb0aea
pass apiClient to determineBaseRepo
...
Our code had an unspoken assumption that only one apiClient is created
during the course of a command. Violating this assumption is fine in
almost all cases, but not when we need to do a re-auth to add a new
oauth scope to a user's token.
There is likely a more elegant solution to the problem but until then
this changes determineBaseRepo to use an existing apiClient.
2020-05-13 14:55:49 -05:00
vilmibm
3a7f56456e
tweak reauth code and request a new scope
2020-05-13 14:24:29 -05:00
vilmibm
ed1a3a60fd
Merge remote-tracking branch 'origin/master' into wingkwong/master
2020-05-13 13:43:09 -05:00
vilmibm
c8e9768bf5
slopwip on interactive review
2020-05-11 15:28:12 -05:00
vilmibm
1675a677d6
hide credits from main help
2020-05-11 12:04:24 -05:00
Mislav Marohnić
1f0db96f2a
Avoid relying on Cobra help internals
2020-05-11 12:38:22 +02:00
Corey Johnson
70223d1e32
Don't always use the root command help
...
Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
2020-05-08 09:19:19 -07:00
Nate Smith
d908320050
Merge pull request #786 from cli/oauth-read-org
...
Ask for `read:org` OAuth scope, warn for outdated tokens
2020-04-28 20:23:44 -05:00
Nate Smith
fb7b5446d1
Update command/root.go
...
Co-Authored-By: Corey Johnson <probablycorey@gmail.com>
2020-04-28 20:19:52 -05:00