feat: implement edit and delete host commands

- Add edit command with flag-based and interactive update modes
- Add delete command with confirmation prompt and --force flag
- Include delete alias 'rm' for convenience
- Add comprehensive tests for both commands
- Update project state documentation
This commit is contained in:
swanadiva
2026-06-23 13:52:10 +07:00
parent 368b7cdadb
commit d6b810de47
5 changed files with 453 additions and 8 deletions
+34
View File
@@ -0,0 +1,34 @@
package main
import (
"testing"
)
func TestDeleteCommandExists(t *testing.T) {
if deleteCmd == nil {
t.Fatal("deleteCmd should not be nil")
}
if deleteCmd.Use != "delete <host-name-or-id>" {
t.Errorf("expected Use 'delete <host-name-or-id>', got '%s'", deleteCmd.Use)
}
if deleteCmd.Short == "" {
t.Error("Short description should not be empty")
}
}
func TestDeleteCommandFlags(t *testing.T) {
expectedFlags := []string{"force"}
for _, flagName := range expectedFlags {
if deleteCmd.Flags().Lookup(flagName) == nil {
t.Errorf("flag '%s' should be defined", flagName)
}
}
}
func TestDeleteArgs(t *testing.T) {
if deleteCmd.Args == nil {
t.Error("Args validator should not be nil")
}
}