2023-11-05 01:28:11 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2024-01-23 17:55:06 +00:00
|
|
|
cli "v/cli"
|
2024-02-01 01:15:01 +00:00
|
|
|
commands "v/commands"
|
2024-01-26 04:20:26 +00:00
|
|
|
python "v/python"
|
2024-01-23 17:45:08 +00:00
|
|
|
state "v/state"
|
2023-11-05 01:28:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2023-11-29 01:24:00 +00:00
|
|
|
Version = "0.0.8"
|
2023-11-05 01:58:31 +00:00
|
|
|
Author = "Marc Cataford <hello@karnov.club>"
|
|
|
|
Homepage = "https://github.com/mcataford/v"
|
2023-11-05 01:28:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Main entrypoint.
|
|
|
|
func main() {
|
|
|
|
args := os.Args[1:]
|
2024-01-23 17:45:08 +00:00
|
|
|
currentState := state.ReadState()
|
2023-11-05 01:28:11 +00:00
|
|
|
|
2024-01-26 05:27:46 +00:00
|
|
|
root := cli.Namespace{Label: ""}
|
|
|
|
root.AddCommand(
|
2024-02-01 01:15:01 +00:00
|
|
|
"init", commands.Initialize, "v init", "Initializes the v state.",
|
2024-01-26 05:27:46 +00:00
|
|
|
)
|
2023-11-05 01:28:11 +00:00
|
|
|
|
2024-01-26 05:27:46 +00:00
|
|
|
cli := cli.CLI{
|
|
|
|
Metadata: map[string]string{
|
|
|
|
"Version": Version,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-01-26 05:40:16 +00:00
|
|
|
cli.AddNamespace(root).AddNamespace(python.GetNamespace())
|
2024-01-26 05:27:46 +00:00
|
|
|
|
|
|
|
err := cli.Run(args, currentState)
|
2023-11-05 01:28:11 +00:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|