mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
command: add some common autocomplete predictors
We use boolean flags and module sources in a lot of places, so we'll define global predictors for these which we can use across many commands.
This commit is contained in:
parent
9b5ae9143a
commit
82fefbc599
17
command/autocomplete.go
Normal file
17
command/autocomplete.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/posener/complete"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This file contains some re-usable predictors for auto-complete. The
|
||||||
|
// command-specific autocomplete configurations live within each command's
|
||||||
|
// own source file, as AutocompleteArgs and AutocompleteFlags methods on each
|
||||||
|
// Command implementation.
|
||||||
|
|
||||||
|
// For completing the value of boolean flags like -foo false
|
||||||
|
var completePredictBoolean = complete.PredictSet("true", "false")
|
||||||
|
|
||||||
|
// We don't currently have a real predictor for module sources, but
|
||||||
|
// we'll probably add one later.
|
||||||
|
var completePredictModuleSource = complete.PredictAnything
|
Loading…
Reference in New Issue
Block a user