Refactor CLI to use flags instead of positional arguments
- Change all commands to use flags (--bucket, --prefix, etc.) - Add --config flag to backup command - Support VAULTIK_CONFIG environment variable for config path - Use /etc/vaultik/config.yml as default config location - Add test/config.yaml for testing - Update tests to use environment variable for config path - Add .gitignore for build artifacts and local configs - Update documentation to reflect new CLI syntax
This commit is contained in:
@@ -31,4 +31,20 @@ func TestCLIEntry(t *testing.T) {
|
||||
t.Errorf("Expected command '%s' not found", expected)
|
||||
}
|
||||
}
|
||||
|
||||
// Verify backup command has proper flags
|
||||
backupCmd, _, err := cmd.Find([]string{"backup"})
|
||||
if err != nil {
|
||||
t.Errorf("Failed to find backup command: %v", err)
|
||||
} else {
|
||||
if backupCmd.Flag("config") == nil {
|
||||
t.Error("Backup command missing --config flag")
|
||||
}
|
||||
if backupCmd.Flag("daemon") == nil {
|
||||
t.Error("Backup command missing --daemon flag")
|
||||
}
|
||||
if backupCmd.Flag("cron") == nil {
|
||||
t.Error("Backup command missing --cron flag")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user