Граф коммитов

54 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić 1bb1b025fe Simplify flag handling in `hub release` commands 2016-01-31 22:45:01 +11:00
Mislav Marohnić fa32dae621 Have help for all release subcommands show for `hub help release` 2016-01-31 18:57:44 +11:00
Mislav Marohnić 1918e011a6 Restructure how command usage is stored and displayed
- No more `c.Short` property. Instead, the first line of `c.Long`
  property is considered a short command description.

- The `c.Usage` text can now contain multiple lines.

- The new `c.Synopsis()` method renders usage synopsis for humans:

    Usage: hub my-command --arg
           hub my-command --alternative-arg

- The new `c.HelpText()` method renders synopsis + full help text.
2016-01-25 02:23:26 +11:00
Mislav Marohnić 1b862e3388 Switch from godep & rewriting import paths to GO15VENDOREXPERIMENT 2016-01-20 14:46:44 +11:00
Mislav Marohnić d45511c7aa Fix parsing arguments for `browse` command
After `browse` was indicated as "GitExtension: false", it now gets
automatically parsed by pflag library. That has an adverse effect that
it loses information about the `--` value being passed, since pflag
treats it as terminator value and swallows it silently.

Now, introduce the `args.Terminator` property to check if terminator was
present or not, and use that in `browse` to restore previous behavior.
2015-06-05 01:01:02 +02:00
Jingwen Owen Ou 177640dbd4 Extract logic of printing out to console
Introduce a `console` package which encapsulates logic of printing out
to console. This provides flexibility of discarding output in tests.
It also allows us to unify format of printing to console (if we want to).

This fixes #801.
2015-02-20 13:19:24 -08:00
Jingwen Owen Ou 0bbfad695e Make `lookupCommand` a local method to `Command` 2015-01-12 22:13:41 -08:00
Jingwen Owen Ou 6137851f15 Vendor dependencies by rewriting import paths 2014-11-30 09:16:57 -08:00
Jingwen Owen Ou c49dd3f52f Exit with error if command-line flag parsing fails 2014-04-15 15:56:53 +02:00
Jingwen Owen Ou c03677596e Minor refactoring to Command.subCommandsUsage
For each loop handles nil array. Refactor local var key to usage to be more explicit.
2013-12-30 20:50:20 -08:00
David Calavera 439a0dbe17 Print subcommand lookup errors. 2013-12-29 20:06:28 -08:00
David Calavera df13d0125e Be consistent about the exec name again.
Because this PR is not about that.
2013-12-29 19:54:41 -08:00
David Calavera 609013d800 Allow interspersed arguments. 2013-12-29 19:31:09 -08:00
David Calavera 4fb7042963 Set usage function for subcommands. 2013-12-29 19:20:41 -08:00
David Calavera 109fb85818 Use a POSIX compatible flag parser.
So we can use flags before and after arguments, and we can group boolean flags, just like git does.
2013-12-29 15:07:58 -08:00
David Calavera 6b14c4a7e5 Do not parse the argument for git extensions. 2013-12-29 14:44:09 -08:00
David Calavera 371ae8b432 Add global commands to the runner.
- Use a hash to lookup for commands.
- Add more tests for the command and runner execution.
2013-12-29 14:18:14 -08:00
David Calavera fca6287df9 Print command and subcommand short usage when calling an unknown command. 2013-12-28 21:58:29 -08:00
David Calavera 51428d5449 Allow to chain subcommands using `command.Use(subcommandName, subcommand)`. 2013-12-28 21:24:08 -08:00
David Calavera 2e6c824876 Add command to create releases. 2013-12-19 15:49:36 -08:00
Jingwen Owen Ou 7b8770d228 Add update command 2013-12-18 10:57:01 -08:00
Jingwen Owen Ou 14b7a0e2ee Refactor to command.FormattedUsage() 2013-12-14 07:22:23 -08:00
Jingwen Owen Ou 12edd78d93 Fix typo 2013-10-23 16:25:21 -07:00
Damian Gryski da38984a88 Add a command to list issues for a repository 2013-10-23 22:24:01 +02:00
Jingwen Owen Ou b807210a32 Listing GitHub releases 👯 2013-09-26 12:59:31 -07:00
Theodore Kokkoris 908299191f Added submodule command and tests 2013-07-20 07:32:35 -07:00
Jingwen Owen Ou 57e993bd3b Add cherry-pick stub 2013-07-19 14:26:00 -07:00
Theodore Kokkoris 23fdee0906 Added gh push 2013-07-18 15:47:34 -07:00
Jingwen Owen Ou 0d0dc4753c Add apply stub 2013-07-18 15:09:14 -07:00
Jingwen Owen Ou 19c1ffa619 `gh help` to print help from `gh`
For `git help`, run `gh COMMAND --help`
2013-07-10 16:38:12 -07:00
Jingwen Owen Ou 329d4fa3fa Add fetch stub 2013-07-10 10:49:05 -07:00
Jingwen Owen Ou 995c09c5ee Add create stub 2013-07-09 11:03:07 -07:00
Jingwen Owen Ou 5f956792aa Implement init 2013-07-04 16:29:19 -07:00
Jingwen Owen Ou ccef819232 Create init stub 2013-07-04 16:29:19 -07:00
Jingwen Owen Ou c4425a04e4 Add merge command 2013-07-02 09:59:02 -07:00
Jingwen Owen Ou f2ee200ba4 Implement clone 2013-07-01 10:11:02 -07:00
Jingwen Owen Ou 3e21478773 Fix remote not accepting normal args 2013-06-30 09:00:21 -07:00
Jingwen Owen Ou cc4c4ed068 Expand pull-request and ci-status to avoid alias collision 2013-06-29 13:55:11 -07:00
Jingwen Owen Ou a95f3909c4 Implement alias 2013-06-29 09:54:06 -07:00
Jingwen Owen Ou c294d2b615 Use Args for arguments 2013-06-28 16:49:49 -07:00
Jingwen Owen Ou 09a01be1b7 Rename pull to pr 2013-06-24 15:43:08 -07:00
Jingwen Owen Ou db292bcf5e Clean up git.go 2013-06-24 14:40:05 -07:00
Jingwen Owen Ou 3ee7aeecb5 Add git.Checkout 2013-06-21 13:17:52 -07:00
Jingwen Owen Ou f0379f80b2 Add checkout stub 2013-06-21 11:40:42 -07:00
Jingwen Owen Ou 9bf55c38f6 Fix help format 2013-06-17 14:15:59 -07:00
Jingwen Owen Ou 4c960d3a3f Print git help if it's an extension 2013-06-17 13:56:57 -07:00
Jingwen Owen Ou ea69a8140c Break down commands into categories 2013-06-17 10:19:54 -07:00
Jingwen Owen Ou 4b63fbec86 Rename remoteAdd to remote 2013-06-14 15:48:32 -07:00
Theodore Kokkoris eaf85736ac Added remote add command 2013-06-14 08:47:38 -07:00
Jingwen Owen Ou 724878757e Add fork stub 2013-06-10 21:39:33 -07:00