From a92faf7689fa01595fd613ddd3880e9c301ed558 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 9 May 2017 21:32:16 +0200 Subject: 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. --- pkg/cli/query.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/cli/query.go') 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) { -- cgit v1.3.1