summaryrefslogtreecommitdiff
path: root/run.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-07 07:59:42 +0300
committerEyal Posener <[email protected]>2017-05-07 07:59:42 +0300
commitfd5c13f7ed2e9a3e3a82fa6a4c6ffe649f3f32f2 (patch)
tree796dca6d948ba247381b52744a2d4126268e83ff /run.go
parentc94813be30b569795e953937612a7df5a0741861 (diff)
Remove Name from Command struct
Diffstat (limited to 'run.go')
-rw-r--r--run.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/run.go b/run.go
index 90d0df4..5d9706f 100644
--- a/run.go
+++ b/run.go
@@ -20,10 +20,13 @@ const (
// Run get a command, get the typed arguments from environment
// variable, and print out the complete options
-func Run(c Command) {
+// name is the name of command we want to auto complete.
+// IMPORTANT: it must be the same name - if the auto complete
+// completes the 'go' command, name must be equal to "go".
+func Run(name string, c Command) {
args, ok := getLine()
if !ok {
- cmd.Run(c.Name)
+ cmd.Run(name)
return
}
Log("Completing args: %s", args)