Commit graph

111 commits

Author SHA1 Message Date
Mislav Marohnić
c095a4bead Allow explicitly specifying the hostname for gh operations
Accept the "HOST/OWNER/REPO" syntax or passing a full URL for both the
`--repo` flag and the GH_REPO environment variable and allow setting
GH_HOST environment variable to override just the hostname for
operations that assume "github.com" by default.

Examples:

    $ gh repo clone example.org/owner/repo
    $ GH_HOST=example.org gh repo clone repo

    $ GH_HOST=example.org gh api user
    $ GH_HOST=example.org gh gist create myfile.txt

    $ gh issue list -R example.org/owner/repo
    $ gh issue list -R https://example.org/owner/repo.git
    $ GH_REPO=example.org/owner/repo gh issue list
2020-08-12 16:16:34 +02:00
Mislav Marohnić
47cef736f4 Fix GH_REPO override 2020-08-07 14:47:58 +02:00
Mislav Marohnić
12637d02d6 Isolate pr review command 2020-07-29 19:35:54 +02:00
vilmibm
f3eb092d7e isolate repo fork command and tweak usage
This commit is another isolation refactor, this time for repo fork.
However, I got fed up with the --remote="true|false|prompt" style of
flags and took this opportunity to switch to a set of bool flags:

--remote and --clone
--no-remote and --no-clone

the string args were really non standard and confusing; with only two
bools it was impossible to tell when to prompt.
2020-07-27 13:04:31 -05:00
vilmibm
1831d95433 isolated clone command
This commit hacks the existing repo clone tests into something usable by
the new isolated command. It went ok and was less effort than trying to
introduce the same kind of test format as repo view and gist create.
2020-07-23 16:40:31 -05:00
vilmibm
d92c80b560 just swap BaseRepo implementation 2020-07-23 11:58:22 -05:00
vilmibm
2a99ed9afb add ResolvedBaseRepo 2020-07-23 11:01:29 -05:00
Mislav Marohnić
b838ac4014 Improve no args error handler and extend it to other commands 2020-06-15 21:01:32 +02:00
Mislav Marohnić
acf0046718 api command: support {owner} and {repo} placeholders
When `{owner}` and `{repo}` strings are found in request path (for REST
requests) or `query` (for GraphQL), they are replaced with values from
the repository of the current working directory.
2020-06-11 15:00:29 +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