- 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
33 lines
1.9 KiB
JSON
33 lines
1.9 KiB
JSON
{
|
|
// General
|
|
"cli_description": "CLI tool for generating systemd .timer and .service units",
|
|
"cli_create_description": "Generates a systemd .service and .timer unit",
|
|
// Options
|
|
"option_name": "Name of the unit files (optional, otherwise derived from the exec command)",
|
|
"option_exec": "Command to be executed by systemd",
|
|
"option_calendar": "OnCalendar expression for the timer",
|
|
"option_description": "Description of the timer",
|
|
"option_user": "Creates the unit as a user timer",
|
|
"option_run_as": "Runs the system-wide timer as a specific user (sets User= in the service unit)",
|
|
"option_home": "Sets the HOME variable for the service",
|
|
"option_cwd": "Working directory (WorkingDirectory) for the service process",
|
|
"option_output": "Target directory for the unit files",
|
|
"option_after": "Optional After= directive for the service unit",
|
|
"option_environment": "Environment variables in the format KEY=VALUE",
|
|
"option_logfile": "File path for log output (stdout/stderr)",
|
|
"option_dry_run": "Only outputs the unit files without writing them",
|
|
// Messages
|
|
"unit_written_service": "Service unit written to: {path}",
|
|
"unit_written_timer": "Timer unit written to: {path}",
|
|
"hint_header": "\nℹ️ Note:",
|
|
// Error messages
|
|
"error_write_units": "Error while writing unit files:",
|
|
"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."
|
|
}
|