feat: Implement CLI framework with Cobra
- Add root command with Cobra framework - Implement shell completion support for bash/zsh/fish/powershell - Add version command - Add configuration initialization on startup via PersistentPreRunE - Include verbose (-v/-vv) and debug flags - Set up proper error handling and exit codes Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,11 +11,8 @@ var (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) > 1 && os.Args[1] == "--version" {
|
||||
fmt.Printf("hostkeeper %s (built: %s)\n", version, buildTime)
|
||||
return
|
||||
if err := Execute(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Println("HostKeeper - SSH/SFTP Management Tool")
|
||||
fmt.Println("Run 'hostkeeper --help' for usage.")
|
||||
}
|
||||
Reference in New Issue
Block a user