diff --git a/Gopkg.lock b/Gopkg.lock index 1dc0e963..d07ec387 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -74,8 +74,8 @@ "core", "terminal" ] - revision = "0aa8b6a162b391fe2d95648b7677d1d6ac2090a6" - version = "v1.4.1" + revision = "9f89d9dd66613216993dc300f9f3dbae9c3c9bda" + version = "v1.4.2" [[projects]] name = "gopkg.in/kyokomi/emoji.v1" @@ -92,6 +92,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "0be1d1c2f1a9b1c1f1d63ad065141425b62687efb378f6657b088ddf993c3882" + inputs-digest = "da532fb70b3049dffe6ae9f73b3f0a742452639096a325ac5d2400be6ad0559e" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 995c4772..3e1c7751 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -29,7 +29,7 @@ [[constraint]] name = "gopkg.in/AlecAivazis/survey.v1" - version = "1.4.1" + version = "1.4.2" [[constraint]] name = "gopkg.in/kyokomi/emoji.v1" diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/multiselect.go b/vendor/gopkg.in/AlecAivazis/survey.v1/multiselect.go index 7fd6ca4b..24c4fb35 100644 --- a/vendor/gopkg.in/AlecAivazis/survey.v1/multiselect.go +++ b/vendor/gopkg.in/AlecAivazis/survey.v1/multiselect.go @@ -61,7 +61,7 @@ var MultiSelectQuestionTemplate = ` // OnChange is called on every keypress. func (m *MultiSelect) OnChange(line []rune, pos int, key rune) (newLine []rune, newPos int, ok bool) { - if key == terminal.KeyArrowUp { + if key == terminal.KeyArrowUp || key == 'k' { // if we are at the top of the list if m.selectedIndex == 0 { // go to the bottom @@ -70,7 +70,7 @@ func (m *MultiSelect) OnChange(line []rune, pos int, key rune) (newLine []rune, // decrement the selected index m.selectedIndex-- } - } else if key == terminal.KeyArrowDown { + } else if key == terminal.KeyArrowDown || key == 'j' { // if we are at the bottom of the list if m.selectedIndex == len(m.Options)-1 { // start at the top diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/select.go b/vendor/gopkg.in/AlecAivazis/survey.v1/select.go index 74cb77c3..eefe5cf0 100644 --- a/vendor/gopkg.in/AlecAivazis/survey.v1/select.go +++ b/vendor/gopkg.in/AlecAivazis/survey.v1/select.go @@ -61,8 +61,8 @@ func (s *Select) OnChange(line []rune, pos int, key rune) (newLine []rune, newPo // if the user pressed the enter key if key == terminal.KeyEnter { return []rune(s.Options[s.selectedIndex]), 0, true - // if the user pressed the up arrow - } else if key == terminal.KeyArrowUp { + // if the user pressed the up arrow or 'k' to emulate vim + } else if key == terminal.KeyArrowUp || key == 'k' { s.useDefault = false // if we are at the top of the list @@ -73,8 +73,8 @@ func (s *Select) OnChange(line []rune, pos int, key rune) (newLine []rune, newPo // otherwise we are not at the top of the list so decrement the selected index s.selectedIndex-- } - // if the user pressed down and there is room to move - } else if key == terminal.KeyArrowDown { + // if the user pressed down or 'j' to emulate vim + } else if key == terminal.KeyArrowDown || key == 'j' { s.useDefault = false // if we are at the bottom of the list if s.selectedIndex == len(s.Options)-1 { diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/LICENSE.txt b/vendor/gopkg.in/AlecAivazis/survey.v1/terminal/LICENSE.txt new file mode 100644 index 00000000..e69de29b diff --git a/vendor/gopkg.in/AlecAivazis/survey.v1/validate.go b/vendor/gopkg.in/AlecAivazis/survey.v1/validate.go index a577614a..208eac91 100644 --- a/vendor/gopkg.in/AlecAivazis/survey.v1/validate.go +++ b/vendor/gopkg.in/AlecAivazis/survey.v1/validate.go @@ -8,8 +8,11 @@ import ( // Required does not allow an empty value func Required(val interface{}) error { + // the reflect value of the result + value := reflect.ValueOf(val) + // if the value passed in is the zero value of the appropriate type - if isZero(reflect.ValueOf(val)) { + if isZero(value) && value.Kind() != reflect.Bool { return errors.New("Value is required") } return nil