31 lines
610 B
Go
31 lines
610 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var version = "dev"
|
|
|
|
const usage = `rony-llm-agent — minimal CLI for the rony-llm-agent library
|
|
|
|
Usage:
|
|
rony-llm-agent version Print the library version and exit
|
|
rony-llm-agent help Print this help message and exit`
|
|
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
fmt.Fprintln(os.Stderr, usage)
|
|
os.Exit(1)
|
|
}
|
|
|
|
switch os.Args[1] {
|
|
case "version", "--version", "-v":
|
|
fmt.Printf("rony-llm-agent %s\n", version)
|
|
case "help", "--help", "-h":
|
|
fmt.Println(usage)
|
|
default:
|
|
fmt.Fprintf(os.Stderr, "unknown command: %s\n\n%s", os.Args[1], usage)
|
|
os.Exit(1)
|
|
}
|
|
}
|