Mislav Marohnić
a0458956c0
Add docs to color funcs
2019-11-28 11:55:14 +01:00
Mislav Marohnić
e636e3e613
Merge remote-tracking branch 'origin/master' into cygwin-color
2019-11-28 11:52:45 +01:00
Mislav Marohnić
ebb7f39985
Merge remote-tracking branch 'origin/master' into ansi-colorfunc
2019-11-28 11:48:54 +01:00
Mislav Marohnić
b6fa88337d
Ensure that commands print to a colorable output
...
If a command does `fmt.Print(...)` for output that contains ANSI color
codes, this not safe on Windows. We have to ensure that we always use
the `fmt.Fprint*` family of functions with a writer that was transformed
using `utils.NewColorable()`.
2019-11-27 20:51:51 +01:00
Mislav Marohnić
4148cf76b9
Merge remote-tracking branch 'origin' into win-ansi-color
2019-11-27 20:08:00 +01:00
Mislav Marohnić
24b04b5fca
Make use of ansi.ColorFunc
...
Speed up repeated calls to color functions by using ansi.ColorFunc to
create a closure per each color.
https://godoc.org/github.com/mgutz/ansi#ColorFunc
2019-11-27 19:16:53 +01:00
Mislav Marohnić
004ab1e9db
Fix color output to Git Bash
2019-11-27 18:58:23 +01:00
Mislav Marohnić
4be04aded3
Fix ANSI color output on Windows
2019-11-27 15:43:28 +01:00
Mislav Marohnić
7d904fdef7
Fix detecting terminal under Git Bash on Windows
2019-11-27 15:31:37 +01:00
Mislav Marohnić
7f4833d84e
🔥 unused code
2019-11-26 14:14:31 +01:00
Mislav Marohnić
97a6dc494b
Redesign TablePrinter to avoid SetContentWidth / FitColumns steps
...
The API is now:
- AddField;
- EndRow;
- Render.
2019-11-20 13:29:27 +01:00
Mislav Marohnić
2022f8e74b
Avoid widening table columns that already fit
2019-11-20 12:30:24 +01:00
Mislav Marohnić
9fc80a1f8a
Fix crash with empty table
2019-11-20 12:18:50 +01:00
Mislav Marohnić
02b1f60a24
Merge remote-tracking branch 'origin/master' into table-output
2019-11-20 12:12:09 +01:00
Mislav Marohnić
f30e973b9d
Extract generic row printer that adjusts itself for receiving terminal
...
This makes the approach from `pr list` reusable across other commands
that may benefit from table-based output, e.g. `issue list` or `pr status`
The idea is: instantiate a printer, connect it to stdout, feed it some
data, and it does the rest: colored, truncated column output that fits
into a terminal, or tab-delimited output (no color, no truncation) for
scripts.
2019-11-15 19:19:41 +01:00
Mislav Marohnić
2616da04c4
Only capture stderr of commands that don't have configured Stderr
2019-11-14 20:02:42 +01:00
Nate Smith
2236bd3f7b
Merge pull request #51 from github/colors
...
do not use color when stdout is not a terminal
2019-11-12 11:25:54 -07:00
Mislav Marohnić
32e36d2fe0
Merge branch 'master' into exec-cmd-error-info
2019-11-06 19:36:12 +01:00
nate smith
ffa5ce456a
do not use color when stdout is not a terminal
2019-11-06 10:15:27 -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ć
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
Corey Johnson
a8b7e4c5f3
Add PRView tests
2019-10-16 14:47:47 -07:00
Corey Johnson
9c218075fb
Add bold
2019-10-15 14:55:15 -07:00
Corey Johnson
cff76fbc22
Use gookit for colors
2019-10-15 14:51:33 -07:00
Mislav Marohnić
adf5a832fe
Rename to "github/gh-cli"
2019-10-04 10:50:12 +02:00
nate smith
8dd03144ff
initial commit
2019-10-03 22:20:31 -05:00