Repository: nats-io/nsc
Pull request #238 (2019-11-26 13:59:01)

isolated cli dependencies into github.com/nats-io/cliprompts also shared by the ngs tool


Patch:
diff --git a/Makefile b/Makefile
index d9fb5b6..f26d043 100644
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,10 @@ build: compile
 
 fmt:
 	gofmt -s -w *.go
-	gofmt -s -w cli/*.go
 	gofmt -s -w cmd/*.go
 	gofmt -s -w cmd/store/*.go
 
 	goimports -w *.go
-	goimports -w cli/*.go
 	goimports -w cmd/*.go
 	goimports -w cmd/store/*.go
 
diff --git a/cmd/addaccount.go b/cmd/addaccount.go
index eb48415..5b01aa7 100644
--- a/cmd/addaccount.go
+++ b/cmd/addaccount.go
@@ -22,9 +22,9 @@ import (
 	"fmt"
 	"strings"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/addexport.go b/cmd/addexport.go
index b08ec1a..4605dc6 100644
--- a/cmd/addexport.go
+++ b/cmd/addexport.go
@@ -23,9 +23,9 @@ import (
 
 	"github.com/nats-io/nsc/cmd/store"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/addimport.go b/cmd/addimport.go
index c36a955..955d946 100644
--- a/cmd/addimport.go
+++ b/cmd/addimport.go
@@ -23,9 +23,9 @@ import (
 
 	"github.com/nats-io/nsc/cmd/store"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/addoperator.go b/cmd/addoperator.go
index 87b4055..8e28ae3 100644
--- a/cmd/addoperator.go
+++ b/cmd/addoperator.go
@@ -21,9 +21,9 @@ import (
 	"net/url"
 	"os"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/adduser.go b/cmd/adduser.go
index 9b1da8e..069a6c0 100644
--- a/cmd/adduser.go
+++ b/cmd/adduser.go
@@ -23,12 +23,10 @@ import (
 	"strings"
 	"time"
 
-	"github.com/nats-io/nsc/cmd/store"
-
-	"github.com/nats-io/nsc/cli"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/common.go b/cmd/common.go
index 77c4a89..85ca773 100644
--- a/cmd/common.go
+++ b/cmd/common.go
@@ -33,9 +33,9 @@ import (
 
 	"github.com/dustin/go-humanize"
 	"github.com/mitchellh/go-homedir"
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/dataparams.go b/cmd/dataparams.go
index 8c1e557..b27c4dd 100644
--- a/cmd/dataparams.go
+++ b/cmd/dataparams.go
@@ -16,7 +16,7 @@
 package cmd
 
 import (
-	"github.com/nats-io/nsc/cli"
+	cli "github.com/nats-io/cliprompts"
 )
 
 type DataParams struct {
diff --git a/cmd/deleteexport.go b/cmd/deleteexport.go
index 4ca53dc..205b428 100644
--- a/cmd/deleteexport.go
+++ b/cmd/deleteexport.go
@@ -18,11 +18,10 @@ package cmd
 import (
 	"fmt"
 
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/deleteimport.go b/cmd/deleteimport.go
index 6c0b055..47b0950 100644
--- a/cmd/deleteimport.go
+++ b/cmd/deleteimport.go
@@ -19,11 +19,10 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/deleteuser.go b/cmd/deleteuser.go
index afbb7be..28d6142 100644
--- a/cmd/deleteuser.go
+++ b/cmd/deleteuser.go
@@ -20,9 +20,8 @@ import (
 	"fmt"
 	"os"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/nkeys"
-
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/describejwt.go b/cmd/describejwt.go
index b083987..efd7ec8 100644
--- a/cmd/describejwt.go
+++ b/cmd/describejwt.go
@@ -22,8 +22,8 @@ import (
 
 	"github.com/nats-io/nsc/cmd/store"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
-	"github.com/nats-io/nsc/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/editexport.go b/cmd/editexport.go
index 365607a..3a86e81 100644
--- a/cmd/editexport.go
+++ b/cmd/editexport.go
@@ -20,9 +20,9 @@ import (
 	"fmt"
 	"strconv"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/editoperator.go b/cmd/editoperator.go
index a57b3b9..76a7afc 100644
--- a/cmd/editoperator.go
+++ b/cmd/editoperator.go
@@ -19,9 +19,9 @@ import (
 	"fmt"
 	"strings"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/entity.go b/cmd/entity.go
index 545809d..ff74681 100644
--- a/cmd/entity.go
+++ b/cmd/entity.go
@@ -20,9 +20,9 @@ package cmd
 import (
 	"fmt"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 )
 
diff --git a/cmd/generateactivation.go b/cmd/generateactivation.go
index 695e957..c61f75a 100644
--- a/cmd/generateactivation.go
+++ b/cmd/generateactivation.go
@@ -23,9 +23,9 @@ import (
 	"net/url"
 	"path"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/genericclaimparams.go b/cmd/genericclaimparams.go
index 9110e8e..b36d02c 100644
--- a/cmd/genericclaimparams.go
+++ b/cmd/genericclaimparams.go
@@ -22,11 +22,9 @@ import (
 	"sort"
 	"strings"
 
-	"github.com/nats-io/nsc/cli"
-
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
+	"github.com/nats-io/nsc/cmd/store"
 )
 
 // GenericClaimsParams - TimeParams and tags
diff --git a/cmd/init.go b/cmd/init.go
index d26277a..b214df9 100644
--- a/cmd/init.go
+++ b/cmd/init.go
@@ -20,9 +20,9 @@ import (
 	"fmt"
 	"strings"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/list.go b/cmd/list.go
index 0fdd36a..ff78404 100644
--- a/cmd/list.go
+++ b/cmd/list.go
@@ -20,8 +20,8 @@ import (
 	"fmt"
 	"sort"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 	"github.com/xlab/tablewriter"
diff --git a/cmd/listeditor.go b/cmd/listeditor.go
index 846edf2..8d950d1 100644
--- a/cmd/listeditor.go
+++ b/cmd/listeditor.go
@@ -18,7 +18,7 @@ package cmd
 import (
 	"fmt"
 
-	"github.com/nats-io/nsc/cli"
+	cli "github.com/nats-io/cliprompts"
 )
 
 type ListEditorParam struct {
diff --git a/cmd/migrate.go b/cmd/migrate.go
index 31ee39e..73738b2 100644
--- a/cmd/migrate.go
+++ b/cmd/migrate.go
@@ -23,9 +23,9 @@ import (
 	"path/filepath"
 	"strings"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/numberparams.go b/cmd/numberparams.go
index 8b3dd5d..a9205c0 100644
--- a/cmd/numberparams.go
+++ b/cmd/numberparams.go
@@ -18,7 +18,7 @@ package cmd
 import (
 	"fmt"
 
-	"github.com/nats-io/nsc/cli"
+	cli "github.com/nats-io/cliprompts"
 )
 
 type NumberParams struct {
diff --git a/cmd/pubkeyparams.go b/cmd/pubkeyparams.go
index 3a4dc92..87c3a97 100644
--- a/cmd/pubkeyparams.go
+++ b/cmd/pubkeyparams.go
@@ -18,8 +18,8 @@ package cmd
 import (
 	"fmt"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/pull.go b/cmd/pull.go
index 7589793..10a73d7 100644
--- a/cmd/pull.go
+++ b/cmd/pull.go
@@ -22,8 +22,8 @@ import (
 
 	"github.com/nats-io/nsc/cmd/store"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
-	"github.com/nats-io/nsc/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/push.go b/cmd/push.go
index 66edf2e..d9799f5 100644
--- a/cmd/push.go
+++ b/cmd/push.go
@@ -21,10 +21,9 @@ import (
 	"net/url"
 	"strings"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nsc/cmd/store"
-
-	"github.com/nats-io/nsc/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/revoke_clearactivation.go b/cmd/revoke_clearactivation.go
index e1fb028..3f32eec 100644
--- a/cmd/revoke_clearactivation.go
+++ b/cmd/revoke_clearactivation.go
@@ -19,12 +19,10 @@ import (
 	"fmt"
 	"strconv"
 
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
-
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/revoke_listactivation.go b/cmd/revoke_listactivation.go
index d23b1d9..8a909e7 100644
--- a/cmd/revoke_listactivation.go
+++ b/cmd/revoke_listactivation.go
@@ -20,14 +20,12 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
-	"github.com/xlab/tablewriter"
-
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
+	"github.com/xlab/tablewriter"
 )
 
 func createRevokeListActivationCmd() *cobra.Command {
diff --git a/cmd/revoke_listusers.go b/cmd/revoke_listusers.go
index 7c29038..fed5923 100644
--- a/cmd/revoke_listusers.go
+++ b/cmd/revoke_listusers.go
@@ -19,12 +19,10 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/nats-io/nsc/cmd/store"
-
 	"github.com/nats-io/jwt"
-	"github.com/xlab/tablewriter"
-
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
+	"github.com/xlab/tablewriter"
 )
 
 func createRevokeListUsersCmd() *cobra.Command {
diff --git a/cmd/revokeactivation.go b/cmd/revokeactivation.go
index d011ee4..9aafc5c 100644
--- a/cmd/revokeactivation.go
+++ b/cmd/revokeactivation.go
@@ -20,12 +20,10 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
-
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/revokeclearuser.go b/cmd/revokeclearuser.go
index 7778dc7..79e954d 100644
--- a/cmd/revokeclearuser.go
+++ b/cmd/revokeclearuser.go
@@ -19,11 +19,9 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/nats-io/nsc/cmd/store"
-
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/revokeuser.go b/cmd/revokeuser.go
index 55c5fe6..7ad94f9 100644
--- a/cmd/revokeuser.go
+++ b/cmd/revokeuser.go
@@ -20,12 +20,10 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/nats-io/nsc/cmd/store"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
-
+	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/root.go b/cmd/root.go
index 2cd0d5f..4203b98 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -23,8 +23,8 @@ import (
 	"strconv"
 
 	"github.com/mitchellh/go-homedir"
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 	"github.com/spf13/viper"
diff --git a/cmd/signerparams.go b/cmd/signerparams.go
index 3a36101..9a5ed58 100644
--- a/cmd/signerparams.go
+++ b/cmd/signerparams.go
@@ -20,8 +20,8 @@ import (
 	"os"
 	"strings"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 )
 
 // SignerParams is shared UI for a signer (-K flag). The key
diff --git a/cmd/signingkeyseditor.go b/cmd/signingkeyseditor.go
index 42c7fea..c0baadc 100644
--- a/cmd/signingkeyseditor.go
+++ b/cmd/signingkeyseditor.go
@@ -20,8 +20,8 @@ package cmd
 import (
 	"fmt"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/spf13/cobra"
 )
diff --git a/cmd/store/store.go b/cmd/store/store.go
index f4f3029..b0a0d0b 100644
--- a/cmd/store/store.go
+++ b/cmd/store/store.go
@@ -30,9 +30,9 @@ import (
 	"sync"
 	"time"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 )
 
 const Version = "1"
diff --git a/cmd/timeparams.go b/cmd/timeparams.go
index 63e2e22..0757804 100644
--- a/cmd/timeparams.go
+++ b/cmd/timeparams.go
@@ -21,7 +21,7 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/nats-io/nsc/cli"
+	cli "github.com/nats-io/cliprompts"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/update.go b/cmd/update.go
index b2d679b..f0629c2 100644
--- a/cmd/update.go
+++ b/cmd/update.go
@@ -22,7 +22,7 @@ import (
 
 	"github.com/blang/semver"
 	"github.com/briandowns/spinner"
-	"github.com/nats-io/nsc/cli"
+	cli "github.com/nats-io/cliprompts"
 	"github.com/rhysd/go-github-selfupdate/selfupdate"
 	"github.com/spf13/cobra"
 )
diff --git a/go.mod b/go.mod
index 3cdd342..6972bc6 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,6 @@
 module github.com/nats-io/nsc
 
 require (
-	github.com/AlecAivazis/survey v1.7.0
 	github.com/BurntSushi/toml v0.3.1 // indirect
 	github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b // indirect
 	github.com/blang/semver v3.5.1+incompatible
@@ -11,14 +10,11 @@ require (
 	github.com/fatih/color v1.7.0 // indirect
 	github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c // indirect
 	github.com/inconshreveable/mousetrap v1.0.0 // indirect
-	github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
 	github.com/kr/pty v1.1.3 // indirect
-	github.com/mattn/go-colorable v0.0.9 // indirect
 	github.com/mattn/go-isatty v0.0.4 // indirect
-	github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
-	github.com/mitchellh/go-homedir v1.0.0
-	github.com/mitchellh/go-wordwrap v1.0.0
+	github.com/mitchellh/go-homedir v1.1.0
 	github.com/mitchellh/mapstructure v1.1.2 // indirect
+	github.com/nats-io/cliprompts v0.3.16
 	github.com/nats-io/jwt v0.3.2
 	github.com/nats-io/nats-server/v2 v2.0.1-0.20190625001713-2db76bde3329
 	github.com/nats-io/nats.go v1.8.1
@@ -37,7 +33,6 @@ require (
 	golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 // indirect
 	golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e // indirect
 	golang.org/x/text v0.3.2 // indirect
-	gopkg.in/AlecAivazis/survey.v1 v1.7.0 // indirect
 	gopkg.in/yaml.v2 v2.2.2 // indirect
 )
 
diff --git a/go.sum b/go.sum
index 8d7cc53..c4dc836 100644
--- a/go.sum
+++ b/go.sum
@@ -2,6 +2,7 @@ github.com/AlecAivazis/survey v1.7.0 h1:Hri7k8HCumnCO2ks0BjjYZdnLVL3b/nvfUjUUVJt
 github.com/AlecAivazis/survey v1.7.0/go.mod h1:MVECab6WqEH1aXhj8nKIwF7HEAJAj2bhhGiSjNy3wII=
 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
 github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b h1:sSQK05nvxs4UkgCJaxihteu+r+6ela3dNMm7NVmsS3c=
 github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
 github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
@@ -10,6 +11,7 @@ github.com/briandowns/spinner v0.0.0-20181029155426-195c31b675a7 h1:IvbBe4mOtBLz
 github.com/briandowns/spinner v0.0.0-20181029155426-195c31b675a7/go.mod h1:hw/JEQBIE+c/BLI4aKM8UU8v+ZqrD3h7HC27kKt8JQU=
 github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
 github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
@@ -28,6 +30,7 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu
 github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
 github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
+github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
 github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c h1:kp3AxgXgDOmIJFR7bIwqFhwJ2qWar8tEQSE5XXhCfVk=
 github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
@@ -50,18 +53,21 @@ github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDe
 github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
+github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
 github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
 github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
-github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
-github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
+github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
 github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
 github.com/mitchellh/mapstructure v1.0.0 h1:vVpGvMXJPqSDh2VYHF7gsfQj8Ncx+Xw5Y1KHeTRY+7I=
 github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/nats-io/cliprompts v0.3.16 h1:P0V9+ygF5pGWTxOoyaW30Hx1Hg5GdGvYmAeim1WUQ9M=
+github.com/nats-io/cliprompts v0.3.16/go.mod h1:z7VXOACCA8oEJByXsW/AsHsrqvZlAoQHhVmh9Ash9Jo=
 github.com/nats-io/jwt v0.2.6 h1:eAyoYvGgGLXR2EpnsBUvi/FcFrBqN6YKFVbOoEfPN4k=
 github.com/nats-io/jwt v0.2.6/go.mod h1:mQxQ0uHQ9FhEVPIcTSKwx2lqZEpXWWcCgA7R6NrWvvY=
 github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI=
@@ -108,6 +114,7 @@ github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 github.com/spf13/viper v1.2.1 h1:bIcUwXqLseLF3BDAZduuNfekWG87ibtFxi59Bq+oI9M=
 github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaNVlI=
+github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw=
@@ -118,6 +125,7 @@ github.com/xlab/tablewriter v0.0.0-20160610135559-80b567a11ad5 h1:gmD7q6cCJfBbcu
 github.com/xlab/tablewriter v0.0.0-20160610135559-80b567a11ad5/go.mod h1:fVwOndYN3s5IaGlMucfgxwMhqwcaJtlGejBU6zX6Yxw=
 golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
 golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc=
 golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -137,6 +145,7 @@ golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAG
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180606202747-9527bec2660b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992 h1:BH3eQWeGbwRU2+wxxuuPOdFBmaiBH81O8BugSjHeTFg=
 golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -153,8 +162,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 google.golang.org/appengine v1.3.0 h1:FBSsiFRMz3LBeXIomRnVzrQwSDj4ibvcRexLG0LZGQk=
 google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-gopkg.in/AlecAivazis/survey.v1 v1.7.0 h1:Gr+2QDJ4t2YifLZBDpyq98f4+KcXYbNadCPqwxAdLB4=
-gopkg.in/AlecAivazis/survey.v1 v1.7.0/go.mod h1:2Ehl7OqkBl3Xb8VmC4oFW2bItAhnUfzIjrOzwRxCrOU=
+gopkg.in/AlecAivazis/survey.v1 v1.8.7 h1:oBJqtgsyBLg9K5FK9twNUbcPnbCPoh+R9a+7nag3qJM=
+gopkg.in/AlecAivazis/survey.v1 v1.8.7/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/vendor/github.com/mitchellh/go-homedir/homedir.go b/vendor/github.com/mitchellh/go-homedir/homedir.go
index fb87bef..2537853 100644
--- a/vendor/github.com/mitchellh/go-homedir/homedir.go
+++ b/vendor/github.com/mitchellh/go-homedir/homedir.go
@@ -76,6 +76,16 @@ func Expand(path string) (string, error) {
 	return filepath.Join(dir, path[1:]), nil
 }
 
+// Reset clears the cache, forcing the next call to Dir to re-detect
+// the home directory. This generally never has to be called, but can be
+// useful in tests if you're modifying the home directory via the HOME
+// env var or something.
+func Reset() {
+	cacheLock.Lock()
+	defer cacheLock.Unlock()
+	homedirCache = ""
+}
+
 func dirUnix() (string, error) {
 	homeEnv := "HOME"
 	if runtime.GOOS == "plan9" {
diff --git a/vendor/github.com/nats-io/cliprompts/LICENSE b/vendor/github.com/nats-io/cliprompts/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/vendor/github.com/nats-io/cliprompts/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/vendor/github.com/nats-io/cliprompts/README.md b/vendor/github.com/nats-io/cliprompts/README.md
new file mode 100644
index 0000000..326ef79
--- /dev/null
+++ b/vendor/github.com/nats-io/cliprompts/README.md
@@ -0,0 +1,8 @@
+# CliPrompts
+
+This library isolates third-party CLI library dependencies from tooling such as NSC.
+While you are free to use this as you see fit, the use of this library is intended for
+tooling as is only supported as far as insuring that it works for tools where it is used.
+
+[![License Apache 2](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
+[![ReportCard](http://goreportcard.com/badge/nats-io/cliprompts)](http://goreportcard.com/report/nats-io/cliprompts)
diff --git a/vendor/github.com/nats-io/cliprompts/go.mod b/vendor/github.com/nats-io/cliprompts/go.mod
new file mode 100644
index 0000000..4279e65
--- /dev/null
+++ b/vendor/github.com/nats-io/cliprompts/go.mod
@@ -0,0 +1,11 @@
+module github.com/nats-io/cliprompts
+
+go 1.13
+
+require (
+	github.com/AlecAivazis/survey v1.7.0
+	github.com/mitchellh/go-homedir v1.1.0
+	github.com/mitchellh/go-wordwrap v1.0.0
+	github.com/stretchr/testify v1.2.1
+	gopkg.in/AlecAivazis/survey.v1 v1.8.7 // indirect
+)
diff --git a/vendor/github.com/nats-io/cliprompts/go.sum b/vendor/github.com/nats-io/cliprompts/go.sum
new file mode 100644
index 0000000..ada52dd
--- /dev/null
+++ b/vendor/github.com/nats-io/cliprompts/go.sum
@@ -0,0 +1,28 @@
+github.com/AlecAivazis/survey v1.7.0 h1:Hri7k8HCumnCO2ks0BjjYZdnLVL3b/nvfUjUUVJtHGs=
+github.com/AlecAivazis/survey v1.7.0/go.mod h1:MVECab6WqEH1aXhj8nKIwF7HEAJAj2bhhGiSjNy3wII=
+github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
+github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
+github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
+github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
+github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
+github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
+github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
+github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
+github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
+github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
+github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
+github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7U=
+github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/sys v0.0.0-20180606202747-9527bec2660b h1:5rOiLYVqtE+JehJPVJTXQJaP8aT3cpJC1Iy22+5WLFU=
+golang.org/x/sys v0.0.0-20180606202747-9527bec2660b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+gopkg.in/AlecAivazis/survey.v1 v1.8.7 h1:oBJqtgsyBLg9K5FK9twNUbcPnbCPoh+R9a+7nag3qJM=
+gopkg.in/AlecAivazis/survey.v1 v1.8.7/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
diff --git a/cli/open.go b/vendor/github.com/nats-io/cliprompts/open.go
similarity index 97%
rename from cli/open.go
rename to vendor/github.com/nats-io/cliprompts/open.go
index 6989849..995f505 100644
--- a/cli/open.go
+++ b/vendor/github.com/nats-io/cliprompts/open.go
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-package cli
+package cliprompts
 
 import "os/exec"
 
diff --git a/cli/open_darwin.go b/vendor/github.com/nats-io/cliprompts/open_darwin.go
similarity index 84%
rename from cli/open_darwin.go
rename to vendor/github.com/nats-io/cliprompts/open_darwin.go
index 3958c03..8daf718 100644
--- a/cli/open_darwin.go
+++ b/vendor/github.com/nats-io/cliprompts/open_darwin.go
@@ -1,6 +1,6 @@
 // +build darwin
 
-package cli
+package cliprompts
 
 import "os/exec"
 
diff --git a/cli/open_linux.go b/vendor/github.com/nats-io/cliprompts/open_linux.go
similarity index 83%
rename from cli/open_linux.go
rename to vendor/github.com/nats-io/cliprompts/open_linux.go
index 6a823b7..2324d34 100644
--- a/cli/open_linux.go
+++ b/vendor/github.com/nats-io/cliprompts/open_linux.go
@@ -1,6 +1,6 @@
 // +build !windows,!darwin
 
-package cli
+package cliprompts
 
 import "os/exec"
 
diff --git a/cli/open_windows.go b/vendor/github.com/nats-io/cliprompts/open_windows.go
similarity index 81%
rename from cli/open_windows.go
rename to vendor/github.com/nats-io/cliprompts/open_windows.go
index 41899e0..47ebd97 100644
--- a/cli/open_windows.go
+++ b/vendor/github.com/nats-io/cliprompts/open_windows.go
@@ -1,6 +1,6 @@
 // +build windows
 
-package cli
+package cliprompts
 
 import "os/exec"
 
diff --git a/cli/prompts.go b/vendor/github.com/nats-io/cliprompts/prompts.go
similarity index 99%
rename from cli/prompts.go
rename to vendor/github.com/nats-io/cliprompts/prompts.go
index 134ddd9..68bab36 100644
--- a/cli/prompts.go
+++ b/vendor/github.com/nats-io/cliprompts/prompts.go
@@ -1,4 +1,4 @@
-package cli
+package cliprompts
 
 import (
 	"errors"
diff --git a/cli/sui.go b/vendor/github.com/nats-io/cliprompts/sui.go
similarity index 99%
rename from cli/sui.go
rename to vendor/github.com/nats-io/cliprompts/sui.go
index da8bbaf..4103949 100644
--- a/cli/sui.go
+++ b/vendor/github.com/nats-io/cliprompts/sui.go
@@ -1,4 +1,4 @@
-package cli
+package cliprompts
 
 import (
 	"github.com/AlecAivazis/survey"
diff --git a/cli/wrap.go b/vendor/github.com/nats-io/cliprompts/wrap.go
similarity index 96%
rename from cli/wrap.go
rename to vendor/github.com/nats-io/cliprompts/wrap.go
index 8d4530d..b584637 100644
--- a/cli/wrap.go
+++ b/vendor/github.com/nats-io/cliprompts/wrap.go
@@ -1,4 +1,4 @@
-package cli
+package cliprompts
 
 import (
 	"bytes"
diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/cursor.go b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/cursor.go
index 3bab9ce..4c3b176 100644
--- a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/cursor.go
+++ b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/cursor.go
@@ -6,6 +6,7 @@ import (
 	"bufio"
 	"bytes"
 	"fmt"
+	"io"
 	"regexp"
 	"strconv"
 )
@@ -102,17 +103,32 @@ func (c *Cursor) Location(buf *bytes.Buffer) (*Coord, error) {
 		// Reports the cursor position (CPR) to the application as (as though typed at
 		// the keyboard) ESC[n;mR, where n is the row and m is the column.
 		reader := bufio.NewReader(c.In)
-		text, err := reader.ReadSlice('R')
+		text, err := reader.ReadSlice(byte('R'))
 		if err != nil {
 			return nil, err
 		}
 
 		loc = dsrPattern.FindStringIndex(string(text))
 		if loc == nil {
-			// Stdin contains R that doesn't match DSR.
+			// After reading slice to byte 'R', the bufio Reader may have read more
+			// bytes into its internal buffer which will be discarded on next ReadSlice.
+			// We create a temporary buffer to read the remaining buffered slice and
+			// write them to output buffer.
+			buffered := make([]byte, reader.Buffered())
+			_, err = io.ReadFull(reader, buffered)
+			if err != nil {
+				return nil, err
+			}
+
+			// Stdin contains R that doesn't match DSR, so pass the bytes along to
+			// output buffer.
 			buf.Write(text)
+			buf.Write(buffered)
 		} else {
+			// Write the non-matching leading bytes to output buffer.
 			buf.Write(text[:loc[0]])
+
+			// Save the matching bytes to extract the row and column of the cursor.
 			match = string(text[loc[0]:loc[1]])
 		}
 	}
diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/output.go b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/output.go
index e401c37..6fe11c0 100644
--- a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/output.go
+++ b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/output.go
@@ -6,13 +6,13 @@ import (
 	"io"
 )
 
-// Returns special stdout, which converts escape sequences to Windows API calls
+// NewAnsiStdout returns special stdout, which converts escape sequences to Windows API calls
 // on Windows environment.
 func NewAnsiStdout(out FileWriter) io.Writer {
 	return out
 }
 
-// Returns special stderr, which converts escape sequences to Windows API calls
+// NewAnsiStderr returns special stderr, which converts escape sequences to Windows API calls
 // on Windows environment.
 func NewAnsiStderr(out FileWriter) io.Writer {
 	return out
diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader.go b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader.go
index ebd17e8..74f3d83 100644
--- a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader.go
+++ b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader.go
@@ -41,14 +41,18 @@ func (rr *RuneReader) ReadLine(mask rune) ([]rune, error) {
 
 	// we get the terminal width and height (if resized after this point the property might become invalid)
 	terminalSize, _ := cursor.Size(rr.Buffer())
+	// we set the current location of the cursor once
+	cursorCurrent, _ := cursor.Location(rr.Buffer())
+
 	for {
 		// wait for some input
 		r, _, err := rr.ReadRune()
 		if err != nil {
 			return line, err
 		}
-		// we set the current location of the cursor and update it after every key press
-		cursorCurrent, err := cursor.Location(rr.Buffer())
+		// increment cursor location
+		cursorCurrent.X++
+
 		// if the user pressed enter or some other newline/termination like ctrl+d
 		if r == '\r' || r == '\n' || r == KeyEndTransmission {
 			// delete what's printed out on the console screen (cleanup)
diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader_linux.go b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader_linux.go
index 74e1b69..6dd60ea 100644
--- a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader_linux.go
+++ b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/runereader_linux.go
@@ -2,6 +2,7 @@
 // Copyright 2013 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
+// +build linux,!ppc64le
 
 package terminal
 
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 4ea86dd..1ed3102 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -47,12 +47,14 @@ github.com/mattn/go-colorable
 github.com/mattn/go-isatty
 # github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
 github.com/mgutz/ansi
-# github.com/mitchellh/go-homedir v1.0.0
+# github.com/mitchellh/go-homedir v1.1.0
 github.com/mitchellh/go-homedir
 # github.com/mitchellh/go-wordwrap v1.0.0
 github.com/mitchellh/go-wordwrap
 # github.com/mitchellh/mapstructure v1.1.2
 github.com/mitchellh/mapstructure
+# github.com/nats-io/cliprompts v0.3.16
+github.com/nats-io/cliprompts
 # github.com/nats-io/jwt v0.3.2
 github.com/nats-io/jwt
 # github.com/nats-io/nats-server/v2 v2.0.1-0.20190625001713-2db76bde3329
@@ -132,7 +134,7 @@ google.golang.org/appengine/internal/log
 google.golang.org/appengine/internal/remote_api
 google.golang.org/appengine/internal/urlfetch
 google.golang.org/appengine/urlfetch
-# gopkg.in/AlecAivazis/survey.v1 v1.7.0
+# gopkg.in/AlecAivazis/survey.v1 v1.8.7
 gopkg.in/AlecAivazis/survey.v1/core
 gopkg.in/AlecAivazis/survey.v1/terminal
 # gopkg.in/yaml.v2 v2.2.2


Test patch:
diff --git a/cli/prompts_test.go b/cli/prompts_test.go
deleted file mode 100644
index 0fa9c30..0000000
--- a/cli/prompts_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2018-2019 The NATS Authors
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cli
-
-import (
-	"io/ioutil"
-	"os"
-	"testing"
-
-	"github.com/stretchr/testify/require"
-)
-
-func TestEmailValidator(t *testing.T) {
-	var tests = []struct {
-		value      string
-		shouldFail bool
-	}{
-		{"", false},
-		{"a", true},
-		{"@a", true},
-		{"a@a", false}, // this is a bad, but valid email on a local network
-		{"a@a.com", false},
-	}
-	fun := EmailValidator()
-
-	for _, vv := range tests {
-		err := fun(vv.value)
-		if err != nil && vv.shouldFail == false {
-			t.Fatalf("expected not fail: %v", vv.value)
-		} else if err == nil && vv.shouldFail {
-			t.Fatalf("expected to fail on %v but didn't", vv.value)
-		}
-	}
-}
-
-func TestLengthValidator(t *testing.T) {
-	fun := LengthValidator(0)
-	require.NoError(t, fun(""))
-	require.NoError(t, fun("a"))
-	require.NoError(t, fun("aaa"))
-
-	fun = LengthValidator(1)
-	require.Error(t, fun(""))
-	require.NoError(t, fun("a"))
-	require.NoError(t, fun("aaa"))
-}
-
-func TestPathOrURLValidator(t *testing.T) {
-	fun := PathOrURLValidator()
-	require.Error(t, fun(""))
-	require.Error(t, fun("/tmp"))
-	f, err := ioutil.TempFile("", "file")
-	require.NoError(t, err)
-	defer func() {
-		f.Close()
-		os.Remove(f.Name())
-	}()
-	require.NoError(t, fun(f.Name()))
-	require.NoError(t, fun("http://www.google.com"))
-}
-
-func TestURLValidator(t *testing.T) {
-	fun := URLValidator("http", "https")
-	require.Error(t, fun(""))
-	require.Error(t, fun("/tmp"))
-	require.Error(t, fun("https://"))
-	require.Error(t, fun("ftp://localhost/path"))
-	require.NoError(t, fun("http://localhost/path"))
-	require.NoError(t, fun("http://localhost"))
-	require.NoError(t, fun("HTTP://localhost"))
-	require.NoError(t, fun("https://localhost"))
-}
diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go
index 0e51c82..919b1d6 100644
--- a/cmd/cmd_test.go
+++ b/cmd/cmd_test.go
@@ -22,7 +22,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/nats-io/nsc/cli"
+	cli "github.com/nats-io/cliprompts"
 	"github.com/spf13/cobra"
 )
 
diff --git a/cmd/edituser_test.go b/cmd/edituser_test.go
index 5f089dc..6f2836a 100644
--- a/cmd/edituser_test.go
+++ b/cmd/edituser_test.go
@@ -20,10 +20,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/nats-io/nsc/cli"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
-
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/cmd/init_test.go b/cmd/init_test.go
index 2a109ee..2bea6c6 100644
--- a/cmd/init_test.go
+++ b/cmd/init_test.go
@@ -19,8 +19,7 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/nats-io/nsc/cli"
-
+	cli "github.com/nats-io/cliprompts"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/cmd/revoke_clearactivation_test.go b/cmd/revoke_clearactivation_test.go
index 50d2660..4fdb799 100644
--- a/cmd/revoke_clearactivation_test.go
+++ b/cmd/revoke_clearactivation_test.go
@@ -20,7 +20,6 @@ import (
 	"time"
 
 	"github.com/nats-io/jwt"
-
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/cmd/revoke_listactivation_test.go b/cmd/revoke_listactivation_test.go
index 641c144..2b637a6 100644
--- a/cmd/revoke_listactivation_test.go
+++ b/cmd/revoke_listactivation_test.go
@@ -21,7 +21,6 @@ import (
 	"time"
 
 	"github.com/nats-io/jwt"
-
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/cmd/revokeactivation_test.go b/cmd/revokeactivation_test.go
index f25264e..4da5f15 100644
--- a/cmd/revokeactivation_test.go
+++ b/cmd/revokeactivation_test.go
@@ -20,7 +20,6 @@ import (
 	"time"
 
 	"github.com/nats-io/jwt"
-
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/cmd/util_test.go b/cmd/util_test.go
index 08bd297..dc479fb 100644
--- a/cmd/util_test.go
+++ b/cmd/util_test.go
@@ -29,11 +29,11 @@ import (
 	"testing"
 	"time"
 
+	cli "github.com/nats-io/cliprompts"
 	"github.com/nats-io/jwt"
 	"github.com/nats-io/nats-server/v2/server"
 	nats "github.com/nats-io/nats.go"
 	"github.com/nats-io/nkeys"
-	"github.com/nats-io/nsc/cli"
 	"github.com/nats-io/nsc/cmd/store"
 	"github.com/stretchr/testify/require"
 )
diff --git a/cli/testprompts.go b/vendor/github.com/nats-io/cliprompts/testprompts.go
similarity index 99%
rename from cli/testprompts.go
rename to vendor/github.com/nats-io/cliprompts/testprompts.go
index 3e08be4..70205ec 100644
--- a/cli/testprompts.go
+++ b/vendor/github.com/nats-io/cliprompts/testprompts.go
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-package cli
+package cliprompts
 
 import (
 	"fmt"