Commit graph

53 commits

Author SHA1 Message Date
ihmpavel
72b6dc5d8c
chore: Unify calling gh in examples (#8560) 2024-01-11 09:07:23 -08:00
Andy Feller
b77de0d458 Additional formatting changes
- gh help actions
  - highlight 3 commands to run for more information
- gh extension
  - wrapping url for online linking
  - fix install subcommand missing backtick formatting
- gh release create
  - fixing mixed indenting causing usage misalignment
- root help
  - backtick wrap help command for more info for consistency
- gh help environment
  - backtick wrap missed OWNER/REPO
- gh variable
  - brought consistency to output when deleting or setting variable
2023-12-01 09:08:51 -05:00
Yukai Chou
e31919c8fc Update link to jq docs 2023-11-23 07:20:41 +08:00
Yukai Chou
ba585149c3 Leftovers 2023-11-23 07:12:47 +08:00
Yukai Chou
07a87ca8a4 Wrap special values and placeholders like - and $1 2023-11-23 07:09:29 +08:00
Yukai Chou
21bf1babdf Proof-reading 2023-11-17 02:04:35 +08:00
Yukai Chou
5c4cb50231 Wrap env variables in backticks uniformly 2023-11-17 01:32:00 +08:00
Yukai Chou
896101678f Wrap cli commands in backticks uniformly 2023-11-17 01:32:00 +08:00
Tony F
ae3e879480
Mention setting GH_ENTERPRISE_TOKEN
When GH_HOST is set
2023-05-15 10:49:45 -05:00
William Martin
07ed1e4e8a
Introduce helpTopics type and reduce duplication across commands (#7414) 2023-05-11 14:59:12 +02: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
աɨռɢӄաօռɢ
5a2c24d363
docs: revise GH_CONFIG_DIR content in help_topic.go (#7230) 2023-03-27 01:18:09 +00:00
Sam Coe
05bf29d88e
Introduce GH_PATH environment variable (#7025) 2023-03-07 11:30:10 +11:00
Mislav Marohnić
dbc244a993
Document the hyperlink helper 2022-10-31 15:04:53 +01:00
Ariel Deitcher
7a55496b87 code review feedback 2022-10-03 19:07:32 +03:00
Ariel Deitcher
6785e9fa67 update formatting help command 2022-10-03 03:23:14 -07:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Ariel Deitcher
43325fb3e1
Disable interactive prompting with GH_PROMPT_DISABLED (#6082) 2022-08-17 09:11:54 +03:00
Matthew Runo
621cd4153e Fixes #6024.
Adding documentation for exit codes used by 'gh'
2022-08-15 15:25:39 -07:00
Matthew Runo
9b16d1ecdd Fixes #6024.
Adding documentation for exit codes used by 'gh'
2022-08-15 15:20:19 -07:00
Mislav Marohnić
2139e763fb Write Cobra deprecation messages to stderr
We used to do the equivalent of `rootCmd.SetOut(os.Stdout)` because we
thought that Cobra's "Out" stream represents standard output. However,
upon closer inspection it turns out that this is Cobra's stream for
usage errors and deprecation warnings, and those we want written to
stderr as well. It is not clear to me why Cobra maintains a distinction
between "Out" and "Err" streams since both seem to go to sdterr by
default.

This change also ceases our usage of `command.Print()` functions in
favor of explicitly writing to `IOStreams.Out/ErrOut`.
2022-05-23 20:23:42 +02:00
lylecantcode
56fda0f8c6
Support GH_DEBUG to control verbosity, deprecate DEBUG (#5306)
The GH_DEBUG environment variable is a new gh-specific verbosity control.

For backwards-compatibility, DEBUG will still be respected if it has values
"1", "true", "yes", and "api", but any other values will be ignored.

Finally, support for "oauth" debug value has been dropped in favor of "api".
The "oauth" value only had limited, internal use.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-03-29 18:05:35 +02:00
Kevin Lee
0d143ca89c
Consistent punctuation in command usages (#5139)
* Fix spelling and grammatical errors in command docs
* Add periods for consistency across the long command descriptions
* Format imports
2022-01-31 10:56:12 +00:00
Mislav Marohnić
9b7d53501f Make sure URLs in man pages render as hyperlinks on the web 2021-11-03 15:39:10 +01:00
Peter Benjamin
175da0f58a
Fix rendering issue in "formatting" help topic (#4661)
Signed-off-by: Peter Benjamin <petermbenjamin@gmail.com>
2021-11-02 17:30:49 +00: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ć
af2aecd40b
Merge pull request #4146 from cli/force-tty
Add ability to force terminal-style output even when redirected
2021-08-23 16:46:14 +02:00
Sam
8fb6bb66c8
Merge pull request #3992 from despreston/858-config-browser
add browser option to config
2021-08-17 14:17:54 -07:00
Sam Coe
b9438015a2
Add GH_BROWSER to help topic 2021-08-17 14:10:15 -07:00
Mislav Marohnić
321fd98f82 Add ability to force terminal-style output even when redirected 2021-08-17 20:12:25 +02:00
Mislav Marohnić
fdad37e248
Merge pull request #4019 from cli/enterprise-env
Fix error message when using GH_ENTERPRISE_TOKEN but host is ambiguous
2021-07-27 15:29:14 +02:00
Mislav Marohnić
9033258f5f Clean up GH_CONFIG_DIR docs
This removes the false equivalence between GH_CONFIG_DIR and
XDG_CONFIG_HOME. These settings do not have the same effect and should
not be used for the same purposes.

Also remove the documentation about what `XDG_*` settings do. We simply
conform to the XDG Base Directory Specification, but will not document
it. It's likely that users of these environment variables already know
what they do.
2021-07-20 14:24:11 +02:00
Mislav Marohnić
aec0f10041 Fix error message when using GH_ENTERPRISE_TOKEN but host is ambiguous
Before:

    $ GH_ENTERPRISE_TOKEN="..." gh pr create
    could not find hosts config: not found

Now:

    $ GH_ENTERPRISE_TOKEN="..." gh pr create
    set the GH_HOST environment variable to specify which GitHub host to use

Also amends `gh help environment` documentation to suggest the use of
GH_HOST when scripting operations with GitHub Enterprise repositories.
2021-07-20 14:11:07 +02:00
Sam Coe
389fdb7f99
Add XDG env variables to environment help topic 2021-06-02 09:56:22 -04:00
nate smith
9f451d9eef review feedback 2021-04-29 16:06:26 -05:00
nate smith
9110db7f7e fill in help topic 2021-04-29 10:58:40 -05:00
nate smith
02e9fa086d start on incorrect function error handling 2021-04-28 13:59:54 -05:00
Mislav Marohnić
e327b42f79 Add gh help formatting topic & link to it from commands with JSON output 2021-04-14 18:27:15 +02:00
Nikola Ristić
e87b5bcaff
Add "reference" help topic (#2223)
* Add "reference" help topic

* Only print reference as a help topic

* fix for color fns, slightly generalize

* WIP for switching to markdown

* escape gt/lt

* minor

* higher wrap point

* detect terminal theme

* futz with angle brackets once more

* minor cleanup

* prepend parent commands

* rename help topic fns and add test

* Simplify reference help generation

- the `<...>` characters from command usage line are now preserved by enclosing the entire usage synopsis in a code span
- hard breaks in flag usage lines are preserved by enclosing flag usage in a code block
- TTY detection and Markdown rendering are now delayed until the user explicitly requests `gh help reference`
- `gh help reference` output is now pager-enabled

Co-authored-by: vilmibm <vilmibm@github.com>
Co-authored-by: vilmibm <vilmibm@neongrid.space>
Co-authored-by: Mislav Marohnić <mislav@github.com>
2020-11-18 12:31:36 -06:00
Sam Coe
414de332fb
cleanup 2020-11-12 09:52:14 +03:00
Sam Coe
a79a0bbfd7
Add support for GH_TOKEN and GH_ENTERPRISE_TOKEN 2020-11-12 09:52:10 +03:00
Sam Coe
86906c6769
Small cleanup 2020-11-04 12:40:40 +03:00
Sam Coe
241e90aa9b
Make markdown:generate annotation a markdown generation override for hidden commands 2020-11-04 12:35:58 +03:00
Sam Coe
f770c6481c
Generate markdown for help topics 2020-11-04 12:35:58 +03:00
Sam
c7ede29779
Refactor help topics to include short message 2020-11-04 12:35:58 +03:00
Mislav Marohnić
ce8f37aca2 💅 tweak update notifier 2020-10-09 18:15:28 +02:00
ShubhankarKG
78b67fabdd 1. Added GH_NO_UPDATE_NOTIFIER to hhelp_topics
2. Updated test to check if passed variable is not empty
2020-10-08 21:22:26 +05:30
Teubel György
b71261219c Add support for GH_PAGER 2020-09-29 17:42:25 +02:00
Mislav Marohnić
086d8ed29a Merge remote-tracking branch 'origin' into color-env 2020-09-16 16:51:38 +02:00
Mislav Marohnić
fa2513dea6 Document PAGER environment variable 2020-09-16 16:15:57 +02:00