Add path, existingfile and existingdir types.

- Document custom types.
- Add docker example.
This commit is contained in:
Alec Thomas
2018-06-21 16:16:27 +10:00
parent cdcdf49f67
commit 212ea2a356
11 changed files with 440 additions and 121 deletions
+6 -2
View File
@@ -24,9 +24,13 @@ var cli struct {
func main() {
cmd := kong.Parse(&cli, kong.Description("A shell-like example app."),
kong.HelpOptions(kong.CompactHelp()))
kong.UsageOnError(),
kong.HelpOptions(kong.HelpPrinterOptions{
Compact: true,
Summary: true,
}))
switch cmd {
case "rm <paths>":
case "rm <path>":
fmt.Println(cli.Rm.Paths, cli.Rm.Force, cli.Rm.Recursive)
case "ls":