Documentation ¶
Index ¶
- func All() map[string]string
- func Chdir(u *user.User, path string) error
- func EditFile(u *user.User, path, line, s string) ([]rune, error)
- func Exec(s string) (string, error)
- func Getenv(keys ...string) string
- func Getvar(s string) (bool, string, error)
- func HistoryFile(u *user.User) string
- func OpenFile(u *user.User, path string, relative bool) (string, *os.File, error)
- func PassFile(u *user.User) string
- func PassFileEntry(u *user.User, v *dburl.URL) (*url.Userinfo, error)
- func RCFile(u *user.User) string
- func Set(name, value string) error
- func Unquote(u *user.User, s string, exec bool) (string, error)
- func Unset(name string) error
- func ValidIdentifier(n string) error
- type Vars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chdir ¶ added in v0.5.0
Chdir changes the current working directory to the specified path, or to the user's home directory if path is not specified.
func Exec ¶ added in v0.5.0
Exec runs s using the user's SHELL / COMSPEC (Windows, aka 'ComSpec'), with -c (or /c).
When SHELL or COMSPEC is not defined, then "sh" / "cmd.exe" will be used instead, assuming it is found on the system's PATH.
func Getenv ¶ added in v0.6.0
Getenv tries retrieving successive keys from os environment variables.
func HistoryFile ¶
HistoryFile returns the path to the history file.
Defaults to ~/.<command name>_history, overridden by environment variable <COMMAND NAME>_HISTORY (ie, ~/.usql_history and USQL_HISTORY).
func OpenFile ¶ added in v0.5.0
OpenFile opens a file for reading, returning the full, expanded path of the file. All callers are responsible for closing the returned file.
func PassFile ¶ added in v0.5.0
PassFile returns the path to the password file.
Defaults to ~/.<command name>pass, overridden by environment variable <COMMAND NAME>PASS (ie, ~/.usqlpass and USQLPASS).
func PassFileEntry ¶ added in v0.5.0
PassFileEntry determines if there is a password file entry for a specific database URL.
func RCFile ¶
RCFile returns the path to the RC file.
Defaults to ~/.<command name>rc, overridden by environment variable <COMMAND NAME>RC (ie, ~/.usqlrc and USQLRC).
func ValidIdentifier ¶ added in v0.5.0
ValidIdentifier returns an error when n is not a valid identifier.