Documentation
¶
Index ¶
Constants ¶
View Source
const CategoryPlugin = "Plugin"
View Source
const CategorySDK = "SDK"
View Source
const SelfUpgradeName = "upgrade"
Variables ¶
View Source
var Activate = &cli.Command{ Name: "activate", Hidden: true, Action: activateCmd, Category: CategorySDK, }
View Source
var Add = &cli.Command{ Name: "add", Usage: "Add a plugin or plugins", Flags: []cli.Flag{ &cli.StringFlag{ Name: "source", Aliases: []string{"s"}, Usage: "plugin source", }, &cli.StringFlag{ Name: "alias", Usage: "plugin alias", }, }, Action: addCmd, Category: CategoryPlugin, }
View Source
var Alias = &cli.Command{ Name: "alias", Usage: "Give installed versions of an SDK short names of your own", Category: CategorySDK, Commands: []*cli.Command{ { Name: "set", Usage: "Name an installed version", ArgsUsage: "<sdk> <alias> <version>", Action: aliasSetCmd, }, { Name: "list", Aliases: []string{"ls"}, Usage: "List aliases", ArgsUsage: "[<sdk>]", Action: aliasListCmd, }, { Name: "unset", Usage: "Remove an alias", ArgsUsage: "<sdk> <alias>", Action: aliasUnsetCmd, }, }, }
View Source
var Available = &cli.Command{ Name: "available", Usage: "Show all available plugins", Action: availableCmd, Category: CategoryPlugin, }
View Source
var Cd = &cli.Command{ Name: "cd", Usage: "Launch a shell in the VFOX_HOME or SDK directory", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "plugin", Aliases: []string{"p"}, Usage: "Launch a shell in the plugin directory", }, }, Action: cdCmd, }
View Source
var Config = &cli.Command{ Name: "config", Usage: "Setup, view config", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "list", Aliases: []string{"l"}, Usage: "list all config", }, &cli.BoolFlag{ Name: "unset", Aliases: []string{"un"}, Usage: "remove a config from your config file", }, }, Action: configCmd, }
View Source
var Current = &cli.Command{ Name: "current", Aliases: []string{"c"}, Usage: "Show current version of the target SDK", UsageText: "Show current version of all SDK's if no parameters are passed", Action: currentCmd, Category: CategorySDK, }
View Source
var Doctor = &cli.Command{ Name: "doctor", Usage: "Check vfox and the installed SDKs for problems", ArgsUsage: "[<sdk>[@<version>]]", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "json", Usage: "Output the findings as JSON", }, &cli.BoolFlag{ Name: "adopt", Usage: "Record the current state of versions installed before receipts existed, as the state to compare against later", }, }, Action: doctorCmd, Category: CategorySDK, }
View Source
var Env = &cli.Command{ Name: "env", Flags: []cli.Flag{ &cli.StringFlag{ Name: "shell", Aliases: []string{"s"}, Usage: "shell name", }, &cli.BoolFlag{ Name: "cleanup", Aliases: []string{"c"}, Usage: "cleanup old temp files", }, &cli.BoolFlag{ Name: "json", Aliases: []string{"j"}, Usage: "output json format", }, &cli.BoolFlag{ Name: "full", Usage: "output full env", }, }, Action: envCmd, Category: CategorySDK, }
View Source
var Exec = &cli.Command{ Name: execCommandName, Aliases: []string{execCommandAlias}, Usage: "Execute a command in vfox managed environment", Action: execCmd, }
View Source
var Info = &cli.Command{ Name: "info", Usage: "Show plugin info or SDK path", ArgsUsage: "[<sdk> | <sdk>@<version>]", Action: infoCmd, Category: CategoryPlugin, Flags: []cli.Flag{ &cli.StringFlag{ Name: "format", Aliases: []string{"f"}, Usage: "Format the output using the given Go template", }, &cli.BoolFlag{ Name: "json", Usage: "Output as JSON", }, }, }
View Source
var Install = &cli.Command{ Name: "install", Aliases: []string{"i"}, Usage: "Install a version of the target SDK", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "all", Aliases: []string{"a"}, Usage: "Install all SDK versions recorded in .vfox.toml", }, &cli.BoolFlag{ Name: "yes", Aliases: []string{"y"}, Usage: "Quick installation, skip interactive prompts", }, &cli.BoolFlag{ Name: "reinstall", Usage: "Replace an installed version with a fresh copy, for example after the SDK modified itself in place", }, &cli.BoolFlag{ Name: "use", Aliases: []string{"u"}, Usage: "Use the installed version in the current shell session", }, }, Action: installCmd, Category: CategorySDK, }
View Source
var Link = &cli.Command{ Name: "link", Aliases: []string{"ln"}, Usage: "Use an SDK that is already on this machine as a version", ArgsUsage: "<sdk>@<version> <path> | --detect <sdk>", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "force", Aliases: []string{"f"}, Usage: "Point an already linked version to a different directory", }, &cli.BoolFlag{ Name: "detect", Usage: "Let the plugin look for SDKs on this machine and link what it finds", }, &cli.BoolFlag{ Name: "yes", Aliases: []string{"y"}, Usage: "With --detect, link everything found without asking", }, }, Action: linkCmd, Category: CategorySDK, }
View Source
var List = &cli.Command{ Name: "list", Aliases: []string{"ls"}, Usage: "List all versions of the target SDK", Action: listCmd, Category: CategorySDK, }
View Source
var Plugin = &cli.Command{ Name: "plugin", Usage: "Test and debug a local plugin", Category: CategoryPlugin, Commands: []*cli.Command{ { Name: "test", Usage: "Run Lua test files (offline by default)", ArgsUsage: "<directory>", Flags: []cli.Flag{ &cli.StringFlag{Name: "file", Usage: "Run one test file, relative to the plugin directory"}, &cli.BoolFlag{Name: "online", Usage: "Allow HTTP requests when no response handler is configured"}, &cli.DurationFlag{Name: "timeout", Value: 30 * time.Second, Usage: "Lua and HTTP deadline per file"}, }, Action: pluginTestCmd, }, { Name: "run", Usage: "Invoke one hook (online by default)", ArgsUsage: "<directory> <hook>", Flags: []cli.Flag{ &cli.StringFlag{Name: "input", Value: "{}", Usage: "Hook context as a JSON object"}, &cli.StringFlag{Name: "input-file", Usage: "Read hook context from a JSON file"}, &cli.BoolFlag{Name: "offline", Usage: "Reject HTTP requests"}, &cli.StringFlag{Name: "os", Usage: "Override RUNTIME.osType (e.g. linux, darwin, windows)"}, &cli.StringFlag{Name: "arch", Usage: "Override RUNTIME.archType (e.g. amd64, arm64)"}, &cli.BoolFlag{Name: "json", Usage: "Write only the typed JSON result to stdout"}, &cli.DurationFlag{Name: "timeout", Value: 60 * time.Second, Usage: "Lua and HTTP deadline"}, }, Action: pluginRunCmd, }, }, }
View Source
var Remove = &cli.Command{ Name: "remove", Usage: "Remove a plugin", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "yes", Aliases: []string{"y"}, Usage: "Skip confirmation prompt", }, }, Action: removeCmd, Category: CategoryPlugin, }
View Source
var Search = &cli.Command{ Name: "search", Usage: "Search a version of the target SDK", Action: searchCmd, Category: CategorySDK, }
View Source
var Uninstall = &cli.Command{ Name: "uninstall", Aliases: []string{"un"}, Usage: "Uninstall a version of the target SDK", Action: uninstallCmd, Category: CategorySDK, }
View Source
var Unuse = &cli.Command{ Name: "unuse", Usage: "Unset a version of the target SDK", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Aliases: []string{"g"}, Usage: "Unset from the global environment", }, &cli.BoolFlag{ Name: "project", Aliases: []string{"p"}, Usage: "Unset from the current directory", }, &cli.BoolFlag{ Name: "session", Aliases: []string{"s"}, Usage: "Unset from the current shell session", }, }, Action: unuseCmd, Category: CategorySDK, }
View Source
var Update = &cli.Command{ Name: "update", Usage: "Update specified plugin, use --all/-a to update all installed plugins", Flags: []cli.Flag{ &cli.BoolFlag{ Name: allFlag, Aliases: []string{"a"}, Usage: "all plugins flag", }, }, Action: updateCmd, Category: CategoryPlugin, }
View Source
var Upgrade = &cli.Command{ Name: SelfUpgradeName, Usage: "upgrade vfox to the latest version", Action: upgradeCmd, }
View Source
var Use = &cli.Command{ Name: "use", Aliases: []string{"u"}, Usage: "Use a version of the target SDK", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "global", Aliases: []string{"g"}, Usage: "Used with the global environment", }, &cli.BoolFlag{ Name: "project", Aliases: []string{"p"}, Usage: "Used with the current directory", }, &cli.BoolFlag{ Name: "session", Aliases: []string{"s"}, Usage: "Used with the current shell session (default)", }, &cli.BoolFlag{ Name: "unlink", Usage: "Do not create symlinks for project scope (downgrade to session scope)", }, }, Action: useCmd, Category: CategorySDK, }
Functions ¶
func RequestPermission ¶ added in v0.4.2
func RequestPermission() error
RequestPermission checks that the directory holding the vfox binary is writable. The upgrade stages the download there and renames the new binary over the old one, so it needs write access to the directory, not just to the binary.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.