Added completion for example
diff --git a/examples/bash-completion b/examples/bash-completion
new file mode 100644
index 0000000..eec51dd
--- /dev/null
+++ b/examples/bash-completion
@@ -0,0 +1,8 @@
+_examples() {
+ args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
+
+ COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} __complete -- "${args[@]}"))
+ return 1
+}
+
+complete -F _examples examples
\ No newline at end of file
diff --git a/examples/main.go b/examples/main.go
index 53369b0..4a22be6 100644
--- a/examples/main.go
+++ b/examples/main.go
@@ -10,8 +10,8 @@
)
type EditorOptions struct {
- Input string `short:"i" long:"input" description:"Input file" default:"-"`
- Output string `short:"o" long:"output" description:"Output file" default:"-"`
+ Input flags.Filename `short:"i" long:"input" description:"Input file" default:"-"`
+ Output flags.Filename `short:"o" long:"output" description:"Output file" default:"-"`
}
type Point struct {