diff options
Diffstat (limited to 'backup/src')
-rw-r--r-- | backup/src/main.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/backup/src/main.rs b/backup/src/main.rs index 272c952..22b573f 100644 --- a/backup/src/main.rs +++ b/backup/src/main.rs @@ -11,18 +11,27 @@ use std::{ process::Command, }; +/// Backup-Tool mit inkrementeller Sicherung und Rotation +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + /// Pfad zur Konfigurationsdatei (JSON) + #[arg(short, long)] + config: PathBuf, + + /// Ausführliche Ausgabe + #[arg(short, long, default_value_t = false)] + verbose: bool, +} + #[derive(Debug, Deserialize)] -struct BackupConfig { +struct Config { backup_dir: String, rotate_dir: String, timestamp_file: String, source_file: String, exclude_file: String, -} - -#[derive(Debug, Deserialize)] -struct Config { - backup: BackupConfig, + cycles: Option<u32> } fn read_lines<P: AsRef<Path>>(path: P) -> Result<Vec<String>, Box<dyn Error>> { |