Commit graph

301 commits

Author SHA1 Message Date
Frank Schroeder
193b182195 Issue #195: Compile mousetrap only on Windows
* Create command_win.go and command_notwin.go for windows only code
* Move call to mousetrap hook into separate preExecHook() function
2015-11-24 01:52:16 +01:00
Christoph Görn
b167d9beaa add GNU GPL3 as a license 2015-11-23 11:47:14 -07:00
Anthony Fok
4b096512f3 Reflow license text and add copyright year and name
* Format license text and header to fit within 80 characters per line
 * Remove extra top line from LICENSE file for Apache-2.0
 * Remove the FreeBSD-specific disclaimer from the BSD-2-Clause license
 * Use {{ .copyright }} to add "Copyright © YEAR FULL NAME" to the
   LICENSE file for MIT and BSD licenses.
2015-11-21 23:37:58 -07:00
Anthony Fok
6d6c92d5b7 Parse the full license text as a template
... to allow including "Copyright © 2015 NAME HERE" to the output
LICENSE file where necessary
2015-11-21 23:29:20 -07:00
Anthony Fok
10546a043b Remove extraneous comma at the end of SEE ALSO list 2015-11-21 06:23:56 -07:00
Anthony Fok
9c32fb42ec Reset man page title when necessary in GenManTree
If the user did not define header.Title when calling GenManTree(),
reset it after each call to GenMan(), otherwise the entire man page tree
would be stuck with the full command name that was calculated for the
first man page, leaving all subsequent man pages with an identical
but incorrect title.
2015-11-21 06:18:37 -07:00
Anthony Fok
3bd84ba55c Ensure man page title is uppercase and has rootcmd
As described in http://man7.org/linux/man-pages/man7/man-pages.7.html
2015-11-21 06:13:53 -07:00
Anthony Fok
baf44a3923 Fix Lintian warning: manpage-has-bad-whatis-entry
This patch fixes the problem where lexgrog fails to parse the NAME section
when the provided command contains space, e.g. "rootcmd subcmd".

Explanation from Lintian:

 Each manual page should start with a "NAME" section, which lists the
 name and a brief description of the page separated by "\-".  The "NAME"
 section is parsed by lexgrog and used to generate a database that's
 queried by commands like apropos and whatis.  This tag indicates that
 lexgrog was unable to parse the NAME section of this manual page.

 For manual pages that document multiple programs, functions, files, or
 other things, the part before "\-" should list each separated by a comma
 and a space.  Each thing listed must not contain spaces; a man page for a
 two-part command like "fs listacl" must use something like "fs_listacl"
 in the "NAME" section so that it can be parsed by lexgrog.

Ref: lexgrog(1), groff_man(7), groff_mdoc(7)
2015-11-21 06:12:14 -07:00
Anthony Fok
46c720088b Fix a copy-and-paste error in man_docs.md
Thanks to @goern for reporting the error.

Fixes #188
2015-11-20 17:12:30 -07:00
Anthony Fok
0cc7cc2c06 Fix typo in cobra/cmd/init.go 2015-11-20 15:50:06 -07:00
Steve Francia
e22a0c9315 Better instructions for the execute inside main() 2015-11-20 17:37:40 -05:00
Anthony Fok
4e18e0c2bf Fix typos in README.md: Change "it's" to "its" where appropriate 2015-11-20 15:31:48 -07:00
Anthony Fok
1e63ad8ed1 Fine-tune the formatting of Cobra’s generated code 2015-11-20 15:28:40 -07:00
Anthony Fok
c7feee9f20 Add .mailcap for a more tidy "git shortlog" output 2015-11-20 15:24:23 -07:00
Anthony Fok
1f03277811 Fix minor typos in cobra_test.go 2015-11-20 15:23:16 -07:00
Steve Francia
ec63835b77 Add install instructions for the cobra binary (and library) 2015-11-20 09:55:10 -05:00
spf13
6c0cb34745 Restructure README.md 2015-11-19 08:34:15 -05:00
Eric Paris
cb63a06ed9 Merge pull request #192 from apriendeau/executeC
Creates the ExecuteC function while maintaining Execute signature
2015-11-18 17:09:54 -05:00
Austin Riendeau
3f605993a9 Creates the ExecuteC function while maintaining Execute signature 2015-11-17 13:01:58 -07:00
Anthony Fok
9324f3657d Copyedit README.md 2015-11-15 00:28:22 -07:00
Bjørn Erik Pedersen
f06ae19d96 Revert "Correct Go release version in Travis config (1.5.2)"
This reverts commit 1e1d5137bf.

There is no 1.5.2 ... No idea where I got that impression!?
2015-11-14 17:01:30 +01:00
Greg Osuri
6efbf0b624 README: added cmdns extension 2015-11-09 11:49:37 -05:00
Austin Riendeau
8208714c1b adds accidental removal of section back 2015-11-09 11:48:59 -05:00
Austin Riendeau
d4c0084f5d changes README to have go code ran through gofmt 2015-11-09 11:48:59 -05:00
Bjørn Erik Pedersen
1e1d5137bf Correct Go release version in Travis config (1.5.2) 2015-11-08 21:29:02 +01:00
Austin Riendeau
5144a3aa19 add a flag to disable autogen tag in man and markdown generators
Inherits from parent commands all the way to root
2015-11-08 09:58:38 -05:00
Anthony Fok
e5762054c9 Limit the verbose test workaround to "cobra.test" only
so that full path to the executable or a renamed executable
parses command-line arguments correctly as before.

Special thanks to @apriendeau for discovering "go test -v" failing
and for providing the initial workaround, see #155 and subsequent
discussions.
2015-11-07 23:21:50 -07:00
Austin Riendeau
62e859a9ed fixes verbose tests by checking if the first arg belongs to cobra 2015-11-07 11:42:13 -07:00
Anthony Fok
0e4c02d9cb Restore bash completion behaviour for bash 4.x
In Pull Request #178, the use of `builtin compopt` as a test condition
is inappropriate.  Use `[[ $(type -t compopt) = "builtin" ]]` instead.

Also clean up formatting of the resulting bash completion script.
2015-11-07 04:39:28 -07:00
spf13
5c40aa85ca verbose testing on travis
fixes #157
2015-11-06 11:17:44 -05:00
spf13
2a6ed7a106 utilize filepath.Join liberally
fixes #176
2015-11-06 11:08:12 -05:00
spf13
1d9d665f6f improving project path guessing 2015-11-06 10:44:59 -05:00
Austin Riendeau
bc980b80a1 adds alternative error handling to readme 2015-11-06 08:44:35 -05:00
Fabiano Franz
7290a944e4 Allow marking persistent flags as required or filename 2015-11-06 08:43:09 -05:00
Fabiano Franz
dab963a797 Persistent flags should also be used in completions 2015-11-06 08:43:09 -05:00
Jonathan Boulle
5c3dc12a87 README: correct name of rkt project 2015-11-06 08:42:26 -05:00
Eric Paris
2e6a428921 Merge pull request #179 from eparis/init_comp
Check for _init_completion not_init_completionS
2015-11-03 15:41:40 -05:00
Eric Paris
57c62d3180 Merge pull request #173 from jojomi/master
Update README.md
2015-11-03 15:29:33 -05:00
Eric Paris
9199ed1e52 Merge pull request #178 from mattnenterprise/completions-osx
Modifying bash completions so they can run on OSX
2015-11-03 15:28:50 -05:00
Matt McCoy
428babeb31 Modifying bash completions so they can run on OSX 2015-11-03 15:21:24 -05:00
Eric Paris
58e38f95da Check for _init_completion not_init_completionS 2015-11-03 15:09:37 -05:00
Steve Francia
a22f212832 Add clearer demo gif 2015-11-03 10:07:00 -05:00
Eric Paris
a082ce41f3 Merge pull request #174 from jbowes/fix-duplicate-usage
Ensure the usage command is printed only once
2015-11-02 14:27:52 -05:00
Steve Francia
4f44cb7a62 Add demo gif to readme 2015-11-02 10:55:33 -05:00
Steve Francia
ae5c01791c Add logo to readme 2015-11-02 10:53:04 -05:00
spf13
9bd7cfaa66 Fix bug where project name isn't properly detected 2015-10-31 22:04:55 -04:00
James Bowes
871b0edae2 Ensure the usage command is printed only once
Reverse a swap in logic introduced in #169 that would cause the usage
output to be printed twice.

Fixes #171
2015-10-31 10:22:19 -03:00
jojomi
5fa86d5a21 Update README.md
Fixed typos with `Persistent`
2015-10-30 22:01:50 +01:00
Eric Paris
24562666ea Merge pull request #172 from tamird/patch-1
README: fix CockroachDB typo
2015-10-29 15:18:41 -05:00
Tamir Duberstein
e6d130ddfc README: fix CockroachDB typo 2015-10-29 15:31:43 -04:00