Files
odo/vendor/github.com/hinshun/vt10x/ioctl_posix.go
Chris Laprun f209c678ce Implement interactive mode for service create using survey lib.
* Initial implementation for service create interactive mode.

* Remove unneeded (and troublesome) raw extension unmarshalling.

* Update vendor.

* Isolate interactive mode implementation from command code.

* Unexport functions that don't need to be.

* Rename SelectServiceNameInteractively to EnterServiceNameInteractively.
Add documentation.

* Remove dependency on occlient in ui package.

* Format documentation according to conventions.

* Make todo more specific.

* If title doesn't exist use name instead.

* Actually, always use name and show title as additional info.

* Properly handle interrupts (ctrl-c).

* Improve handling of properties:
- Deal with optional properties
- Check (and ignore) extra provided properties

* Introduce Validator type.

* Improve UI.

* Add basic validation of input.

* Use init function and validators map.

* Initial implementation using survey instead of promptui.

* Update vendor.

* Address code style issues.

* Update glide and vendor.

* Fix improper pointer assignment.

* Proof of concept of promptui-like detail panel.

* Updated for new code organization. Needs lots of improvements.

* Extract ServicePlans creation into NewServicePlans function.
Simplify unmarshalling code.

* Use ServicePlans instead of dealing with info extraction here and remove
option to pass values to EnterServicePropertiesInteractively.

* Rename catalogUI to simply ui.

* Move ui package to where it's used and makes more sense.

* Make service plan parameters sortable by name.

* Make EnterServicePropertiesInteractively more easily testable.

* Extract fake plan details creation functions so that they can be reused.

* Add ui tests but it is currently failing… Update vendor dependencies.

* Disable color output to simplify testing.

* Duplicate survey test infrastructure and adapt ui_test accordingly.

* Remove now unneeded stdio function.

* Make providing value required.

* Only attempt to unmarshal extension if it exists.

* Fix crash if filtered entries resulted in empty pageEntries.

* Restore original template once we're done with the selection.

* Use a more explicit template function name and improve template changes.

* Use defer to restore template and template functions once done.

* Use survey.ComposeValidators and remove chainedValidator.

* Skip the test until we can figure out what is wrong with it.

* Fix improper imports.

* Fix style errors.

* Add documentation to exported functions.

* Rename ServicePlans to ServicePlan (no reason for it to be plural).

* Should error out if the service class is not found.

* Fix link.

* Add documentation.

* Fix missing display and potential panic.

* Service name was improperly validated.

* Remove additional information display as it's causing display issues.

* Update survey to latest version.

* Re-add service class detail since it is now fixed and improve output.

* Work around issue with repeated question when lines wrap in terminal.

* Update to survey 1.8.0.

* Use 1 error code.

* Create a constant for the default number of columns before text wraps.

* Add comments.

* Add comment for golint to pick up.

* Add comment.

* Add documentation to ServiceCreateOptions struct.

* Fix potentially invalid logic.

* Fix improper output (expected vs actual were reversed).

* Extract more common functions to services and add more tests.

* Delete unused function.

* Default to default column number if detected width is 0. Add tests.

* Update vendor information.

* Add more tests.

* Add documentation.
2019-01-17 13:17:32 +01:00

32 lines
592 B
Go

// +build linux darwin dragonfly solaris openbsd netbsd freebsd
package vt10x
import (
"os"
"syscall"
"unsafe"
)
func ioctl(f *os.File, cmd, p uintptr) error {
_, _, errno := syscall.Syscall(
syscall.SYS_IOCTL,
f.Fd(),
syscall.TIOCSWINSZ,
p)
if errno != 0 {
return syscall.Errno(errno)
}
return nil
}
func ResizePty(pty *os.File, cols, rows int) error {
var w struct{ row, col, xpix, ypix uint16 }
w.row = uint16(rows)
w.col = uint16(cols)
w.xpix = 16 * uint16(cols)
w.ypix = 16 * uint16(rows)
return ioctl(pty, syscall.TIOCSWINSZ,
uintptr(unsafe.Pointer(&w)))
}