Commit Graph

2009 Commits

Author SHA1 Message Date
Jesse Szwedko
03f77c6e74 Fix new example for v2 branch 2016-10-29 14:33:41 -07:00
Jesse Szwedko
83497d2cda Merge remote-tracking branch 'origin/master' into v2-merge 2016-10-29 14:13:18 -07:00
Jesse Szwedko
76d8eaf9fe Merge pull request #490 from nlewo/v2-completion
Generate completion code
2016-10-25 21:55:42 -07:00
Jesse Szwedko
f614c177b7 Merge pull request #543 from wking/app-description
app: Add App.Description
2016-10-25 21:54:02 -07:00
Jesse Szwedko
b803494208 Merge pull request #542 from mhmxs/patch-1
Display error instead of just say command is incorrect
2016-10-25 21:52:14 -07:00
Richard Kovacs
668cf38bbe Merge branch 'master' into patch-1 2016-10-24 09:45:24 +02:00
W. Trevor King
3c2bce5807 help: Cleanup AppHelpTemplate trailing whitespace
Most of the changes here remove trailing whitespace, but I also add
code to select "AUTHOR" or "AUTHORS" as appropriate instead of the
previous "AUTHOR(S)".  The template for listing with an entry per line
is:

   {{range $index, $entry := pipeline}}{{if $index}}
   {{end}}{{$entry}}{{end}}

That range syntax is discussed in [1].

Also add a unit test, which tests both these whitespace changes and
also the earlier App.Description addition.

[1]: https://golang.org/pkg/text/template/#hdr-Variables
2016-10-22 16:02:21 -07:00
W. Trevor King
0c143a2a26 app: Fix trailing space for Author.String()
This code initially landed with lots of space:

  '{name}  <{email}> '

or:

  '{name} '

in 3d718330 (app, help: add support for multiple authors, 2015-01-31).
The doubled space between the name and email was removed in c6592bb4
(app, help: add backwards compatibility for Authors, 2015-02-21), but
a trailing space remained in both the email and email-less cases.
This commit removes that trailing space.
2016-10-22 15:58:07 -07:00
Jesse Szwedko
6f2647a880 Merge pull request #544 from runcom/sort-flags
flags: sort flags
2016-10-22 10:29:59 -07:00
Jesse Szwedko
64fcd51526 Merge branch 'master' into sort-flags 2016-10-22 10:22:16 -07:00
Jesse Szwedko
3f4989051e Merge pull request #550 from runcom/test-go-1-7
.travis.yml: add go 1.7.x
2016-10-22 09:40:07 -07:00
Antonio Murdaca
d913b71c72
.travis.yml: add go 1.7.x
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-21 10:46:51 +02:00
Antonio Murdaca
c516bce8f1
flags: provide a type to sort flags
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-21 10:37:18 +02:00
Richard Kovacs
4cc2bad36e Display error instead of just say command is incorrect 2016-10-19 13:31:05 +02:00
Jesse Szwedko
508a23430b Default app.Writer to os.Stdout
As NewApp() does.

Fixes #545
2016-10-18 20:56:31 -07:00
W. Trevor King
c4a46a7df2 app: Add App.Description
So you can describe what the application is for without requiring
users to drill down into a particular command.
2016-10-12 08:06:41 -07:00
Jesse Szwedko
55f715e28c Merge pull request #541 from dotCipher/patch-1
Typo in comments
2016-10-05 20:53:53 -07:00
Cody Moore
6c2c80959b Typo in comments
Typo changing `implents` to `implements`
2016-10-05 11:17:03 -07:00
HIROSE Masaaki
ce42837702 Call HandleExitCoder for all members of MultiError.Errors 2016-09-30 19:23:44 +09:00
Jesse Szwedko
d53eb99165 Merge pull request #531 from keloyang/SkipFlagParsing-SkipArgReorder-bugfix
bug fix when SkipFlagParsing is false and SkipArgReorder is true
2016-09-17 14:38:06 -07:00
Shukui Yang
5d108a4435 bug fix when SkipFlagParsing is false and SkipArgReorder is true
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2016-09-12 21:30:33 +08:00
Jesse Szwedko
61f519fe5e Merge pull request #528 from urfave/backport-no-arg-reordering
Backport no argument reordering as an option
2016-09-11 20:00:11 -07:00
Frances Bar
3df4b71842 Backport no argument reordering as an option
In the unreleased version 2, the argument reordering has been removed
(in f585ec7cb8) since it only worked if
all of the arguments appeared before all of the flags, but not if they
were intermixed which was of limited utility and caused some confusion.
This commit allows enabling of this future behavior via SkipArgReorder.

Ideally we'd support complete intermingling of flags and arguments, but
this is unlikely to happen until we switch flag parsers.

Fixes #515
2016-09-11 12:04:35 -07:00
86b8c43eaf Merge pull request #521 from urfave/update-wording-around-gopkgin
Update wording around gopkg.in pinning to be more accurate
2016-09-11 14:27:17 -04:00
b425397570 Merge branch 'master' into update-wording-around-gopkgin 2016-09-11 11:43:05 -04:00
bf7166a9d7 Merge pull request #527 from urfave/dereference-flag-pointers
Dereference `Flag`s if they are pointers
2016-09-11 11:42:40 -04:00
Jesse Szwedko
e7b1833f53 Dereference Flags if they are pointers
When checking if environment variables are set.

We don't support pointer flags currently (though this is the default in
the `v2` branch), but this fixes #516
2016-09-08 21:10:46 -07:00
c723b19a84 Merge pull request #522 from nthnca/typo
Fix typo in README
2016-09-05 07:50:38 -04:00
Nathan Bullock
76164d6e36 Fix typo in README
cosumized -> customized
2016-09-05 07:16:05 -04:00
Jesse Szwedko
4b62cb6b33 Update wording around gopkg.in pinning to be more accurate
Since we have `v1.X` tags, gopkg.in/urfave/cli.v1 will pull the latest
tagged release rather than the `v1` branch. Since there are no tagged
`v2` releases, `gopkg.in` will pull the latest commit of that branch.

Fixes #513
2016-09-03 14:23:36 -07:00
Jesse Szwedko
df95e0708f Manually set import in altsrc flag generation
Otherwise `goimports` switches it to `github.com/urfave/cli`
2016-09-03 14:22:45 -07:00
lewo
6aa0ab6903 Merge branch 'v2' into v2-completion 2016-09-01 09:35:02 +02:00
c72728f424 Merge pull request #514 from grubernaut/f-default-value-text
Add DefaultValue text for flags
2016-08-31 13:44:05 -04:00
Jake Champlin
c8d66d7eda
Lowercase TOC to pass tests 2016-08-30 11:12:22 -04:00
Jake Champlin
51cebd042a
Update TOC in README 2016-08-30 10:56:28 -04:00
Jake Champlin
33b5174be4 Merge branch 'v2' into f-default-value-text 2016-08-30 10:53:16 -04:00
Jake Champlin
7d56512ecc
Add documentation, remove quotes by default 2016-08-30 10:52:24 -04:00
Jesse Szwedko
2616eeb540 Merge pull request #512 from grubernaut/f-update-altsrc-import-v2
Update altsrc imports to gopkg.in
2016-08-28 13:23:17 -07:00
Jesse Szwedko
33bb4c1213 Merge pull request #511 from grubernaut/f-update-altsrc-import-v1
Fix import paths in altsrc
2016-08-28 13:23:14 -07:00
Jake Champlin
e0556cf9e8
Add DefaultValue text for flags
Allows a user to override the default value of a flag in the displayed help output.

Ex:
```
cli.IntFlag{
	Name: "foo, f",
	DefaultText: "random foo",
	Value: "bar",
}
```

Running `(app.name) -h` will now yield:

```
--foo value     (default: "random foo")
```

Fixes: #504
2016-08-28 03:14:39 -04:00
Jake Champlin
2ab83fab2a
Force generation of flag types to use gopkg import 2016-08-28 01:36:49 -04:00
Jake Champlin
b93207160f
Update altsrc imports to gopkg.in
Updates altsrc imports to use `gopkg.in/urfave/cli.v2`

Fixes: #505
2016-08-27 19:14:15 -04:00
Jake Champlin
c75c862386
Fix import paths in altsrc
Uses gopkg.in as the import path for the `altsrc` package.

Fixes: #473
2016-08-27 19:09:14 -04:00
a095a5a896 Merge pull request #506 from grubernaut/v2
Abstract dependency and test execution with Makefile
2016-08-26 09:56:24 -04:00
Jake Champlin
3a3228c0e4
Abstract dependency and test execution with Makefile
Abstract the `runtests` script with a makefile, and update travis tests to use makefile abstraction.
2016-08-26 08:34:05 -04:00
05fe449c81 Merge pull request #508 from urfave/remove-end-user-deprecation-warnings
remove the possiblity of end-user's seeing deprecation warnings
2016-08-23 11:25:51 -04:00
adf6897aa2 Merge pull request #509 from urfave/merging-from-v1
Merging from v1
2016-08-23 11:25:16 -04:00
Dan Buch
812fa64d8e
Skip migrations on go < 1.3
because there won't be a `gfmrun` around to extract examples
2016-08-22 17:54:51 -04:00
2506863832 Merge branch 'master' into remove-end-user-deprecation-warnings 2016-08-22 17:49:40 -04:00
Dan Buch
87f9c6d44a
Merge remote-tracking branch 'origin/master' into merging-from-v1 2016-08-22 17:47:11 -04:00