Documentation ¶
Overview ¶
Copyright 2019-2020 vChain, Inc.
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.
Index ¶
- Constants
- Variables
- func Detached()
- func PrintTable(cols []string, nbRows int, getRow func(int) []string)
- func PrintfColor(color string, format string, args ...interface{})
- func QuitToStdErr(msg interface{})
- func QuitWithUserError(err error)
- func ReadFromTerminalYN(def string) (selected string, err error)
- func ResolvePath(origPath string, parse bool) (finalPath string, err error)
- func UsageSprintf(usages map[string][]string) string
- type Options
- type PasswordReader
- type RequiredArgs
Constants ¶
const DetachedFlag = "detached"
const DetachedShortFlag = "d"
const LinuxManPath = "/usr/share/man/man1/"
Variables ¶
var Blue = "\033[34m"
var Cyan = "\033[36m"
var Green = "\033[32m"
var Purple = "\033[35m"
var Red = "\033[31m"
var Reset = "\033[0m"
var White = "\033[37m"
var Yellow = "\033[33m"
Functions ¶
func PrintfColor ¶ added in v0.6.1
func QuitToStdErr ¶
func QuitToStdErr(msg interface{})
QuitToStdErr prints an error on stderr and closes
func ReadFromTerminalYN ¶
ReadFromTerminalYN read terminal user input from a Yes No dialog. It returns y and n only with an explicit Yy or Nn input. If no input is submitted it returns default value. If the input is different from the expected one empty string is returned.
func ResolvePath ¶
ResolvePath
func UsageSprintf ¶
Types ¶
type Options ¶
type Options struct {
CfgFn string
}
Options cmd options
func (*Options) InitConfig ¶
InitConfig initializes config
type PasswordReader ¶
var DefaultPasswordReader PasswordReader = new(stdinPasswordReader)