forked from shyiko/kubesec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
230 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package complete_test | ||
|
||
import "github.com/posener/complete" | ||
|
||
func main() { | ||
|
||
// create a Command object, that represents the command we want | ||
// to complete. | ||
run := complete.Command{ | ||
|
||
// Name must be exactly as the binary that we want to complete | ||
Name: "run", | ||
|
||
// Sub defines a list of sub commands of the program, | ||
// this is recursive, since every command is of type command also. | ||
Sub: complete.Commands{ | ||
|
||
// add a build sub command | ||
"build": complete.Command{ | ||
|
||
// define flags of the build sub command | ||
Flags: complete.Flags{ | ||
// build sub command has a flag '-fast', which | ||
// does not expects anything after it. | ||
"-fast": complete.PredictNothing, | ||
}, | ||
}, | ||
}, | ||
|
||
// define flags of the 'run' main command | ||
Flags: complete.Flags{ | ||
|
||
// a flag '-h' which does not expects anything after it | ||
"-h": complete.PredictNothing, | ||
|
||
// a flag -o, which expects a file ending with .out after | ||
// it, the tab completion will auto complete for files matching | ||
// the given pattern. | ||
"-o": complete.PredictFiles("*.out"), | ||
}, | ||
} | ||
|
||
// run the command completion, as part of the main() function. | ||
// this triggers the autocompletion when needed. | ||
complete.Run(run) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.