@@ -62,12 +62,12 @@ var CLI struct {
|
|||||||
Force bool `help:"Force removal."`
|
Force bool `help:"Force removal."`
|
||||||
Recursive bool `help:"Recursively remove files."`
|
Recursive bool `help:"Recursively remove files."`
|
||||||
|
|
||||||
Paths []string `arg name:"path" help:"Paths to remove." type:"path"`
|
Paths []string `arg:"" name:"path" help:"Paths to remove." type:"path"`
|
||||||
} `cmd help:"Remove files."`
|
} `cmd:"" help:"Remove files."`
|
||||||
|
|
||||||
Ls struct {
|
Ls struct {
|
||||||
Paths []string `arg optional name:"path" help:"Paths to list." type:"path"`
|
Paths []string `arg:"" optional:"" name:"path" help:"Paths to list." type:"path"`
|
||||||
} `cmd help:"List paths."`
|
} `cmd:"" help:"List paths."`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -155,12 +155,12 @@ var CLI struct {
|
|||||||
Force bool `help:"Force removal."`
|
Force bool `help:"Force removal."`
|
||||||
Recursive bool `help:"Recursively remove files."`
|
Recursive bool `help:"Recursively remove files."`
|
||||||
|
|
||||||
Paths []string `arg name:"path" help:"Paths to remove." type:"path"`
|
Paths []string `arg:"" name:"path" help:"Paths to remove." type:"path"`
|
||||||
} `cmd help:"Remove files."`
|
} `cmd:"" help:"Remove files."`
|
||||||
|
|
||||||
Ls struct {
|
Ls struct {
|
||||||
Paths []string `arg optional name:"path" help:"Paths to list." type:"path"`
|
Paths []string `arg:"" optional:"" name:"path" help:"Paths to list." type:"path"`
|
||||||
} `cmd help:"List paths."`
|
} `cmd:"" help:"List paths."`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -208,7 +208,7 @@ type RmCmd struct {
|
|||||||
Force bool `help:"Force removal."`
|
Force bool `help:"Force removal."`
|
||||||
Recursive bool `help:"Recursively remove files."`
|
Recursive bool `help:"Recursively remove files."`
|
||||||
|
|
||||||
Paths []string `arg name:"path" help:"Paths to remove." type:"path"`
|
Paths []string `arg:"" name:"path" help:"Paths to remove." type:"path"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RmCmd) Run(ctx *Context) error {
|
func (r *RmCmd) Run(ctx *Context) error {
|
||||||
@@ -217,7 +217,7 @@ func (r *RmCmd) Run(ctx *Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type LsCmd struct {
|
type LsCmd struct {
|
||||||
Paths []string `arg optional name:"path" help:"Paths to list." type:"path"`
|
Paths []string `arg:"" optional:"" name:"path" help:"Paths to list." type:"path"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *LsCmd) Run(ctx *Context) error {
|
func (l *LsCmd) Run(ctx *Context) error {
|
||||||
@@ -228,8 +228,8 @@ func (l *LsCmd) Run(ctx *Context) error {
|
|||||||
var cli struct {
|
var cli struct {
|
||||||
Debug bool `help:"Enable debug mode."`
|
Debug bool `help:"Enable debug mode."`
|
||||||
|
|
||||||
Rm RmCmd `cmd help:"Remove files."`
|
Rm RmCmd `cmd:"" help:"Remove files."`
|
||||||
Ls LsCmd `cmd help:"List paths."`
|
Ls LsCmd `cmd:"" help:"List paths."`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -351,7 +351,7 @@ You would use the following:
|
|||||||
```go
|
```go
|
||||||
var CLI struct {
|
var CLI struct {
|
||||||
Ls struct {
|
Ls struct {
|
||||||
Files []string `arg type:"existingfile"`
|
Files []string `arg:"" type:"existingfile"`
|
||||||
} `cmd`
|
} `cmd`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -370,7 +370,7 @@ You would use the following:
|
|||||||
var CLI struct {
|
var CLI struct {
|
||||||
Config struct {
|
Config struct {
|
||||||
Set struct {
|
Set struct {
|
||||||
Config map[string]float64 `arg type:"file:"`
|
Config map[string]float64 `arg:"" type:"file:"`
|
||||||
} `cmd`
|
} `cmd`
|
||||||
} `cmd`
|
} `cmd`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user