Mislav Marohnić
23d739dffd
[api] Add extended documentation for hub-api(1)
2019-01-24 20:05:26 +01:00
Mislav Marohnić
95592b5701
[api] Improve caching
...
- sort query string in cache key
- include "Accept", "Authorization" headers in cache key
- allow caching of `/graphql` responses
2019-01-24 20:05:26 +01:00
Mislav Marohnić
9239deaa67
[api] Avoid potentially leaking OAuth token to 3rd parties
...
This ensures that calling `hub api http://example.com/foo ` doesn't
accidentally send the OAuth token for `github.com` to `example.com`.
2019-01-24 20:05:26 +01:00
Mislav Marohnić
0692cee64c
[api] Handle non-200 HTTP response
2019-01-24 20:05:26 +01:00
Mislav Marohnić
699e268672
[api] Expand `{owner}`, `{repo}` in graphql queries
2019-01-24 20:05:26 +01:00
Mislav Marohnić
a5d360344f
[api] Add `--raw-field` that has no special treatment for "@"
2019-01-24 20:05:26 +01:00
Mislav Marohnić
1567d0c495
[api] New `hub api` command
2019-01-24 20:05:26 +01:00
Mislav Marohnić
700a806a1f
go fmt
2019-01-24 20:03:14 +01:00
Mislav Marohnić
b2215853b9
Remove broken tests
2019-01-24 19:55:48 +01:00
Mislav Marohnić
c4d1838898
Crash reporter improvements
...
- print error output on stderr instead of stdout
- only prompt to open an issue if connected to terminal
- get rid of "always" option in the prompt
- empty response to the prompt is interpreted as a "no"
2019-01-24 16:02:26 +01:00
Mislav Marohnić
90523e4da6
Tweak descriptions of several commands
2019-01-21 21:54:34 +01:00
Mislav Marohnić
c6ea574542
Merge branch 'args-parser'
2019-01-21 21:41:08 +01:00
Mislav Marohnić
f5df7cab9f
Passing values for long-form flags is now available without `=`
2019-01-21 21:35:15 +01:00
Mislav Marohnić
99e18c8b3b
Docs: avoid saying "project" where we mean "repository"
...
[ci skip]
2019-01-21 12:50:24 +01:00
Mislav Marohnić
fba26b09fa
Clarify description and homepage fields for `hub create`
...
Fixes #2011 [ci skip]
2019-01-21 12:42:49 +01:00
Mislav Marohnić
cdd5ce9264
Only publish HTML man pages if the tag is cut off master
...
[ci skip]
2019-01-18 19:01:31 +01:00
Mislav Marohnić
22fc159d0b
Fix `issue create --assign LIST` and documentation
2019-01-18 05:13:19 +01:00
Mislav Marohnić
80a8fe31f9
Stop testing against go 1.8
...
Go 1.8 doesn't have the `testing.Helper()` method
https://travis-ci.org/github/hub/jobs/481181084
2019-01-18 04:32:44 +01:00
Mislav Marohnić
09710c7745
Remove unused `ogier/pflag`
2019-01-18 04:16:46 +01:00
Mislav Marohnić
86f956fbd0
Switch md2roff to new args parser
2019-01-18 04:09:43 +01:00
Mislav Marohnić
3d41d7e91f
Raise `UsageError()` on invalid arguments
2019-01-18 04:09:43 +01:00
Mislav Marohnić
ee31304ba7
Switch `issue` to new args parser
2019-01-18 04:09:43 +01:00
Mislav Marohnić
f06e506ef8
Switch `release` to new args parser
2019-01-18 03:47:50 +01:00
Mislav Marohnić
26d2a1fa4a
Fix usage synopsis for nested commands
...
This is displayed for e.g. flag parsing errors like `hub pr list --foo`
2019-01-18 03:47:50 +01:00
Mislav Marohnić
5aeeb680ab
Switch `pr` to new args parser
2019-01-18 03:47:50 +01:00
Mislav Marohnić
db76bc5bf5
Switch `create` to new args parser
2019-01-18 03:47:50 +01:00
Mislav Marohnić
33eb313452
Switch `compare` to new args parser
2019-01-18 03:47:48 +01:00
Mislav Marohnić
2ca05c036e
Switch `browse` to new args parser
2019-01-18 01:50:29 +01:00
Mislav Marohnić
1e733219a7
Switch `alias`, `ci-status`, `delete`, `fork` to new args parser
2019-01-18 01:50:28 +01:00
Mislav Marohnić
f0a1f617a5
Simplify some args preprocessing
2019-01-18 01:50:28 +01:00
Mislav Marohnić
01565e4fff
Use ArgsParser for `hub help`
2019-01-18 01:50:28 +01:00
Mislav Marohnić
ebcc3897d5
Clear up `hub pull-request --issue` documentation
...
Passing a URL to `--issue` has never worked. It has to be a number.
Passing a URL like `hub pull-request <ISSUE-URL>` has worked but hasn't
been documented. I do not wish to add it to documentation now, as it may
be dropped in the future.
2019-01-18 01:50:28 +01:00
Mislav Marohnić
d0f126f95e
Switch pull-request to ArgsParser
2019-01-18 01:50:28 +01:00
Mislav Marohnić
c0db6e6f0c
Use ArgsParser for commands that don't declare flags via pflag
2019-01-18 01:50:28 +01:00
Mislav Marohnić
ae96e939d3
Initialize ArgsParser from usage string
2019-01-17 02:39:08 +01:00
Mislav Marohnić
8f1b5c7f7f
Use ArgsParser for `hub remote add` extension
2019-01-17 02:39:08 +01:00
Mislav Marohnić
8d96d21bbd
Simplify transformApplyArgs
2019-01-17 02:39:08 +01:00
Mislav Marohnić
796d1b5ae1
Use ArgsParser for `hub clone` extension
2019-01-17 02:39:08 +01:00
Mislav Marohnić
9eae131eef
Create a lightweight CLI flag parser
...
Design considerations:
- treats `--flag=VALUE` as equivalent of `--flag VALUE`
- treats `-abcVALUE` as equivalent to `-a -b -c VALUE`
- allows `--opt=false` as opposite of `--opt` or `--opt=true`
- retrieve values as string, slice of strings, bool, or int
2019-01-17 02:39:08 +01:00
Mislav Marohnić
ddf0d82510
Merge pull request #1980 from apjanke/improve-label-contrast-ratios
...
Improve label contrast ratios
2019-01-08 02:39:29 +01:00
Mislav Marohnić
757e68e631
Merge pull request #1996 from github/fix-label-sort
...
Fix alphabetical sort of `hub issue labels` output
2019-01-03 04:59:58 +01:00
Mislav Marohnić
16ff60ec65
Fix alphabetical sort of `hub issue labels` output
...
The API result isn't guaranteed to be sorted case-insensitive, so we
perform the sort in memory before displaying.
2019-01-03 04:43:25 +01:00
Mislav Marohnić
1c2c69ae44
Simplify picking contrasting label text color
...
Pick between white and black depending on which one is the first to
satisfy the contrast ratio of 7.0 (or 4.5 as fallback).
2019-01-03 04:40:15 +01:00
Mislav Marohnić
d0310e9c4b
Restore compatibility with Go 1.8/1.9
2019-01-03 02:47:14 +01:00
Mislav Marohnić
fccfb060b2
Print usage help on stdout when `--help` was requested
2019-01-03 02:26:13 +01:00
Mislav Marohnić
8373accbcc
Print short usage help when running `hub pr` instead of raw markdown
...
Fixes #1919
2019-01-03 02:25:07 +01:00
Andrew Janke
cd307c4c81
Use uint8 RGB color components
2019-01-02 16:46:52 -05:00
Mislav Marohnić
fab4e042fe
Preserve order of hosts in hub config file
...
This fixes the seemingly random order of hosts in the interactive prompt
on `hub init -g`, `hub clone`, etc.
2019-01-02 18:27:50 +01:00
Mislav Marohnić
4f0bb5df67
Respect chosen Enterprise host on `hub init -g`
...
Fixes #1991
2019-01-02 17:11:29 +01:00
Mislav Marohnić
f56701cdc9
Merge pull request #1994 from eli-schwartz/goflags
...
build: respect environment LDFLAGS and strip the build path
2019-01-02 17:04:53 +01:00