26 lines
492 B
Go
26 lines
492 B
Go
|
|
// Package cli provides the core CLI functionality.
|
||
|
|
package cli
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Run executes the CLI with the given arguments.
|
||
|
|
func Run(args []string) error {
|
||
|
|
if len(args) == 0 {
|
||
|
|
fmt.Println("testbed2 CLI")
|
||
|
|
fmt.Println("Usage: testbed2 <command>")
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
switch args[0] {
|
||
|
|
case "help", "--help", "-h":
|
||
|
|
fmt.Println("Available commands:")
|
||
|
|
fmt.Println(" help Show this help message")
|
||
|
|
default:
|
||
|
|
return fmt.Errorf("unknown command: %s", args[0])
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|