v/python/cli.go
Marc Cataford 6d72d1e51d
refactor(python-cli): push python namespace to python module
fix: use namespace in integration test

docs: update references to commands with namespace
2024-01-26 00:47:30 -05:00

24 lines
818 B
Go

package python
import (
cli "v/cli"
)
func GetNamespace() cli.Namespace {
pythonCommands := cli.Namespace{Label: "python"}
pythonCommands.AddCommand(
"install", installPython, "v python install <version>", "Downloads, builds and installs a new version of Python.",
).AddCommand(
"uninstall", uninstallPython, "v python uninstall <version>", "Uninstalls the given Python version.",
).AddCommand(
"use", use, "v python use <version>", "Selects which Python version to use.",
).AddCommand(
"ls", listVersions, "v python ls", "Lists the installed Python versions.",
).AddCommand(
"version", currentVersion, "v python version", "Prints the current version and its source.",
).AddCommand(
"which", which, "v python which", "Prints the path to the current Python version.",
)
return pythonCommands
}