package main import ( "os" cli "v/cli" state "v/state" ) const ( Version = "0.0.8" Author = "Marc Cataford " Homepage = "https://github.com/mcataford/v" ) // Main entrypoint. func main() { args := os.Args[1:] currentState := state.ReadState() cli := cli.CLI{ Metadata: map[string]string{ "Version": Version, }, } err := cli.AddCommand( "install", InstallPython, "v install ", "Downloads, builds and installs a new version of Python.", ).AddCommand( "uninstall", UninstallPython, "v uninstall ", "Uninstalls the given Python version.", ).AddCommand( "use", Use, "v use ", "Selects which Python version to use.", ).AddCommand( "ls", ListVersions, "v ls", "Lists the installed Python versions.", ).AddCommand( "version", CurrentVersion, "v version", "Prints the current version and its source.", ).AddCommand( "which", Which, "v which", "Prints the path to the current Python version.", ).AddCommand( "init", Initialize, "v init", "Initializes the v state.", ).Run(args, currentState) if err != nil { panic(err) } }