aboutsummaryrefslogtreecommitdiff
path: root/pkg/cli/query.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2017-05-09 21:32:16 +0200
committerStefan Majewsky <majewsky@gmx.net>2017-05-09 21:38:24 +0200
commita92faf7689fa01595fd613ddd3880e9c301ed558 (patch)
treef6607fa23ac41385f9f18d8ed6ad0f970c4ba6df /pkg/cli/query.go
parenta4dfbab3b06360245f6b2fce4b56d6caf2729f8f (diff)
downloadgofu-a92faf7689fa01595fd613ddd3880e9c301ed558.tar.gz
refactor cli.Interface yet again
- Only one global instance now, so we don't need to pass it around all the time. - Allow to swap out the Command.Run implementation for unit tests. - Can now use cli.Interface during func init() of packages importing pkg/cli.
Diffstat (limited to 'pkg/cli/query.go')
-rw-r--r--pkg/cli/query.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/cli/query.go b/pkg/cli/query.go
index ed9e913..d9aa9a2 100644
--- a/pkg/cli/query.go
+++ b/pkg/cli/query.go
@@ -41,7 +41,7 @@ func (e errInterrupted) Error() string {
// TUI implementation for when stdin is a terminal
type terminalTUI struct {
- i *Interface
+ i *Implementation
}
func (t terminalTUI) ReadLine(prompt string) (string, error) {
@@ -78,7 +78,7 @@ type Choice struct {
Shortcut byte
//The display string that describes this choice.
Text string
- //The string to return from Interface.Query().
+ //The string to return from Implementation.Query().
Return string
}
@@ -228,7 +228,7 @@ func (b *buffer) getNextInput() []byte {
// TUI implementation for when stdin is a pipe
type pipeTUI struct {
- i *Interface
+ i *Implementation
}
func (t *pipeTUI) ReadLine(prompt string) (string, error) {