fix doc
This commit is contained in:
parent
7c7ab2f59a
commit
dd939deef3
4
doc.go
4
doc.go
|
@ -57,14 +57,12 @@ Add bash completion capabilities to any Go program. See ./example/command.
|
||||||
"github.com/posener/complete/v2"
|
"github.com/posener/complete/v2"
|
||||||
"github.com/posener/complete/v2/predict"
|
"github.com/posener/complete/v2/predict"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Add variables to the program.
|
// Add variables to the program.
|
||||||
name = flag.String("name", "", "")
|
name = flag.String("name", "", "")
|
||||||
something = flag.String("something", "", "")
|
something = flag.String("something", "", "")
|
||||||
nothing = flag.String("nothing", "", "")
|
nothing = flag.String("nothing", "", "")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Create the complete command.
|
// Create the complete command.
|
||||||
// Here we define completion values for each flag.
|
// Here we define completion values for each flag.
|
||||||
|
@ -93,7 +91,6 @@ To use this feature, simply call `complete.CommandLine` before `flag.Parse`. (Se
|
||||||
// Define flags here...
|
// Define flags here...
|
||||||
foo = flag.Bool("foo", false, "")
|
foo = flag.Bool("foo", false, "")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Call command line completion before parsing the flags - provide it with the binary name.
|
// Call command line completion before parsing the flags - provide it with the binary name.
|
||||||
+ complete.CommandLine("my-program")
|
+ complete.CommandLine("my-program")
|
||||||
|
@ -115,7 +112,6 @@ flag with values, it is possible to use the `github.com/posener/complete/compfla
|
||||||
- foo = flag.Bool("foo", false, "")
|
- foo = flag.Bool("foo", false, "")
|
||||||
+ foo = compflag.Bool("foo", false, "")
|
+ foo = compflag.Bool("foo", false, "")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Call command line completion before parsing the flags.
|
// Call command line completion before parsing the flags.
|
||||||
+ complete.CommandLine("my-program")
|
+ complete.CommandLine("my-program")
|
||||||
|
|
Loading…
Reference in New Issue