Commit graph

25 commits

Author SHA1 Message Date
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
b70b0402eb
Merge pull request #3200 from cli/table-widths
Ensure that table printer always uses all available width in the terminal
2021-03-30 16:54:13 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
ed15bebb84 Ensure that table printer fills the full width of the terminal
Sometimes, due to rounding errors, after calculating the width of each
column in a table, the sum of all columns would be shorter that the
total available width in the terminal. This reimplements the elastic
column resizing algorithm to ensure that all available space has been
filled.

As a bonus fix, columns that contain URLs are never truncated.
2021-03-11 19:04:57 +01:00
boonhong
5403a37601 Add interactive select in gist view 2021-02-24 18:38:05 +08:00
Mislav Marohnić
cd2adfeba0 Port listing gists to githubv4 GraphQL client
- Fetching more than 100 gists is now supported
- The GraphQL query name is now `GistList` instead of `ListGists` for
  consistency with other queries
- Avoid fetching unnecessary Files fields
- Gists are now rendered in the order that the API returned them in
- The gist timestamp for machine-readable output is now rendered in
  RFC3339 format instead of in `time.Time.String()` format which is only
  meant for debugging and is not considered stable
- Ensure newlines in gist description are rendered as spaces
2020-10-05 20:33:31 +02:00
Mislav Marohnić
1859728f7e Fix parsing gist list --public/--secret flags
It's not sufficient to use `Changed("public")` to test if a boolean flag
was activated, since the user might have passed `--public=false`.
Instead, check the true value of the flag.

The `--public` and `--secret` flags should be mutually exclusive, so now
if both are activated, `--secret` takes precedence.
2020-10-05 20:27:05 +02:00
Matthew Gleich
f124370154
♻️ Refactor to only pass time in once for test
Signed-off-by: Matthew Gleich <email@mattglei.ch>
2020-10-04 15:02:13 -04:00
Matthew Gleich
d8ef8b836e
🐛 Fix stubs
Signed-off-by: Matthew Gleich <email@mattglei.ch>
2020-10-04 01:57:36 -04:00
Matthew Gleich
89e1ee3217
♻️ Refactor gist list to use graphQL
Signed-off-by: Matthew Gleich <matthewgleich@gmail.com>
2020-09-17 16:27:23 -04:00
vilmibm
2b70e8266a better time stub 2020-09-16 10:57:20 -05:00
vilmibm
4a467864d5 linter appeasement 2020-09-15 15:22:28 -05:00
vilmibm
a61c897e4c show filename if no description 2020-09-15 14:55:55 -05:00
vilmibm
ba5b639be4 finish list tests 2020-09-15 14:33:14 -05:00
vilmibm
9fd87faadc wip tests 2020-09-15 14:15:44 -05:00
vilmibm
425f707c7d fix tests 2020-09-15 13:36:32 -05:00
vilmibm
1887fc07c9 working on list tests, need to debug 2020-09-15 09:39:30 -05:00
vilmibm
b3266d9454 linter appeasement 2020-09-14 11:10:17 -05:00
vilmibm
2df6a6eb8c s/private/secret/ 2020-09-14 11:04:37 -05:00
vilmibm
1edff18ad4 s/private/secret 2020-09-14 10:38:35 -05:00
vilmibm
269adab75a improve list output 2020-09-14 10:33:29 -05:00
vilmibm
02d94d6f93 hmm 2020-09-14 10:33:29 -05:00
vilmibm
0d3056d9a7 gh gist edit 2020-09-14 10:33:29 -05:00
vilmibm
b17124157c start on gist view 2020-09-14 10:33:29 -05:00
vilmibm
f7c4a0cf3f gh gist list 2020-09-14 10:33:29 -05:00