feat(validation): add CLI validation helpers for input checks

- Introduce functions to validate CLI inputs like paths, identifiers, and environment variables
- Add error messages for invalid inputs to support user feedback
- Include unit tests to ensure correctness and robustness of validation logic
This commit is contained in:
2025-05-30 12:42:25 +02:00
parent 5d3afd30bd
commit 5510ab74d6
5 changed files with 343 additions and 2 deletions

View File

@@ -22,5 +22,11 @@
"hint_header": "\nℹ️ Hinweis:",
// Error messages
"error_write_units": "Fehler beim Schreiben der Units:",
"rollback_failed": "Rollback fehlgeschlagen:"
"rollback_failed": "Rollback fehlgeschlagen:",
"error_invalid_env": "Ungültiges Environment-Format. Verwende KEY=VALUE.",
"error_path_schold_not_be_empty": "Pfad darf nicht leer sein.",
"error_path_not_found": "Pfad nicht gefunden: {path}",
"error_value_should_not_be_empty": "Wert ({label}) sollte nicht leer sein.",
"error_invalid_identifier": "Ungültiger Bezeichner: '{value}' für {identifier}. Erlaubt sind nur alphanumerische Zeichen, Unterstriche und Bindestriche.",
"error_invalid_calendar": "Ungültiger OnCalendar-Ausdruck: {value}. Bitte überprüfe die Syntax."
}

View File

@@ -22,5 +22,11 @@
"hint_header": "\nℹ️ Note:",
// Error messages
"error_write_units": "Error while writing unit files:",
"rollback_failed": "Rollback failed:"
"rollback_failed": "Rollback failed:",
"error_invalid_env": "Invalid environment format. Use KEY=VALUE.",
"error_path_schold_not_be_empty": "Path should not be empty.",
"error_path_not_found": "Path not found: {path}",
"error_value_should_not_be_empty": "Value ({label}) should not be empty.",
"error_invalid_identifier": "Invalid identifier: '{value}' for {identifier}. Only alphanumeric characters, underscores, and hyphens are allowed.",
"error_invalid_calendar": "Invalid OnCalendar expression: {value}. Please check the syntax."
}