Commit graph

86 commits

Author SHA1 Message Date
William Martin
15ba536317 Ensure subtests use the right t during setup 2023-12-06 14:06:28 +01:00
William Martin
239f983ad4 Use real config in auth check tests 2023-12-06 14:06:28 +01:00
Qiming Xu
5e14987d65
Fix determining executable location in PATH (#8238) 2023-11-14 08:26:19 +00:00
Sam Coe
7924878315
Fix git protocol and refactor Config interface (#8246) 2023-10-27 15:42:05 +02:00
Raj Hawaldar
9fc571499f
pr checks return distinct exit code for PENDING checks (#7866) 2023-08-25 10:30:45 -07:00
Jun Nishimura
508065b72d
Add verbose flag to api cmd (#7826) 2023-08-25 09:37:37 -07:00
Martijn Pieters
530002ee7a
Pretty-print JSON results of jq filtering (#7236)
When connected to a TTY, tell the jq formatter to indent the output, and
enable colorization of the output if the terminal supports it.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-04-25 13:27:17 +00:00
Sam Coe
dbc2f05124
Update go-gh to v2 (#7299)
* Update go-gh

* Update code for go-gh v2
2023-04-16 15:34:23 +10:00
Benjamin Chadwick
82662685e3
Autocomplete branch flags (#6031)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-03-29 16:09:44 +00:00
Benjamin Levesque
9596fd5368
Skip checking keyring for token in certain scenarios (#7169) 2023-03-18 08:59:43 +11:00
Sam Coe
05bf29d88e
Introduce GH_PATH environment variable (#7025) 2023-03-07 11:30:10 +11:00
Sam Coe
c9a2d85793
Cleanup config.AuthToken and config.DefaultHost methods (#7049) 2023-02-28 00:24:45 +00:00
Sam Coe
a33e12a21d
Refactor Config interface in preperation for encrypted token storage (#7033) 2023-02-28 10:51:12 +11:00
Mislav Marohnić
607a0876b9
Split issue commands into "General" vs. "Targeted" 2022-12-20 17:56:51 +01:00
Sam Coe
2944f7c3ab
Create git client (#6354) 2022-10-14 07:47:03 +00:00
Nate Smith
b2d1955b05
Merge pull request #6296 from heaths/issue6089
Add more help to "template" flags
2022-10-04 14:53:18 -05:00
Eng Zer Jun
471cbea4fa
test: use t.Setenv to set env vars in tests (#6333)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-09-26 08:46:02 +00:00
Heath Stewart
cd63b0eac5 Add more help to "template" flags
Resolves #6089
2022-09-17 23:12:48 -07:00
Mislav Marohnić
436d9ef859
Fix "missing method Fd" crash on Windows (#6200)
This ensures that `IOStreams.Out` always keeps the original `Fd()` value even if it's wrapped as a Colorable stream for Windows in cases when enabling virtual terminal processing has failed.
2022-09-06 17:29:06 +02:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
vilmibm
f7d5c5f725 move prompter to own package 2022-07-26 16:41:13 -05:00
vilmibm
4afb567d06 WIP: survey wrapper 2022-07-26 14:39:38 -05:00
Sam Coe
cacff4ad6d
Use go-gh config package (#5771) 2022-06-23 11:50:04 +00:00
Mislav Marohnić
7387346196 Fix determining the current executable under Homebrew for Linux
We need to use `os.Lstat` instead of `os.Stat` if we are going to
manually inspect files for whether they are a symlink. On macOS, it
looks like `os.Stat` returns information about the symlink itself.
2022-06-20 15:25:29 +02:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Roshan Padaki
13342cb272
Don't error on list commands when no results found (#5479)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-04-25 17:55:52 +00:00
xiaotong
4a5864708c
Add label list and label create commands (#5316) 2022-03-29 17:38:59 +00:00
Sam Coe
e0045f26b9
Add top level search command and search repos sub command (#5172) 2022-03-09 12:24:27 +00:00
Mislav Marohnić
19563c4a74 Use StringEnumFlag helper in more places 2022-02-18 12:52:47 +01:00
Jonathan Mayer
1eefda0b45
gh auth login: add git protocol flag (#5158)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-02-17 19:35:59 +00:00
Mislav Marohnić
3cce16e72d Refactor factory.Executable() to be a method rather than a func
This way, factory can satisfy an interface that requires `Executable()`.
2021-12-21 13:50:55 +01:00
Gowtham Munukutla
98217fc38c gh repo edit
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-07 19:28:29 +01:00
rsteube
d794a929da
Fix stack overflow in AddJSONFlags (#4614)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-10-27 14:56:59 +02:00
Mislav Marohnić
83a08aa3ba Remove unnecessary pointers to Go maps 2021-10-25 17:20:12 +02:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Alan Donovan
7215522123 use FlagError 2021-10-21 10:06:11 -04:00
Mislav Marohnić
d853ce5bc9 Avoid resolving executable() until requested at runtime
This is to avoid hitting the filesystem and resolving symlinks
unnecessarily. The value of executable is just used conditionally by a
handful of commands.
2021-09-24 14:42:41 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Cuong Manh Le
6cf6bb4a44 Disable auth for cobra shell request completion hidden commands
Those hidden command are used by the shell completion scripts, but they
are not disabled auth check. Thus, the shell completion does not work
even the completion setup was done properly.

Fixes #4188
2021-08-25 01:35:49 +07:00
Heath Stewart
e2973453b5
Add helper template functions for rendering tables (#3519)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 21:00:25 +02:00
Mislav Marohnić
4b499be96b
Merge pull request #3942 from dscho/complete--repo-flag
Allow auto-completing the `--repo` values
2021-07-28 17:27:56 +02:00
Mislav Marohnić
d6b70beeaa List repos from non-default hostnames in completions for -R 2021-07-28 17:18:56 +02:00
Johannes Schindelin
b43f78bc19 completions: auto-complete --repo values
Looking at the locally-registered remotes, we have a pretty good idea
what `--repo` values are available. Let's complete them.

Helped by Nate Smith and Mislav Marohnić.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-28 15:36:30 +02:00
Mislav Marohnić
4d7625c8a0 Allow shell-completing multiple --json fields separated by commas 2021-07-21 16:12:38 +02:00
Sam
33c3fb5cdd
Merge pull request #3870 from cli/extensions-revisited
Improvements to gh extensions
2021-06-28 17:12:29 -07:00
Mislav Marohnić
1ec47d8191 Improvements to gh extensions
- Extensions on Windows now enabled through the `sh.exe` interpreter
- `sh.exe` now found on Windows when git was installed via scoop
- `gh extensions list` command shows origin repo for the extension
- `gh extensions upgrade --all` is required to upgrade all extensions
- Added `gh extensions remove`
- Shell completions now include aliases and extension names
- `gh` help output now lists available extension names
- Extensions are stored to XDG_DATA_HOME
2021-06-21 16:54:08 +02:00
Mislav Marohnić
8ff42bf28c Fix repo override 2021-06-17 17:58:46 +02:00
Mislav Marohnić
8dd1e12f64 Merge remote-tracking branch 'origin' into fix-actions-help 2021-06-17 16:13:34 +02:00
Mislav Marohnić
883943946a Add a global pre-run hook to handle auth check and repo override
With auth check being done via Cobra hooks, it is automatically skipped
for non-runnable commands and `-h/--help` flag usage.
2021-06-17 16:01:57 +02:00
Sam Coe
53fac59ef9
Cleanup factory/default and add tests 2021-06-15 09:19:16 -04:00