2 Commits

Author SHA1 Message Date
d94ed4d167 fix: rename args variables 2025-11-14 13:45:40 +01:00
36bc38a5a2 feat: update documentation 2025-11-13 16:20:03 +01:00
4 changed files with 13 additions and 9 deletions

2
Cargo.lock generated
View File

@@ -54,7 +54,7 @@ dependencies = [
[[package]]
name = "bak"
version = "0.2.0"
version = "0.3.2"
dependencies = [
"clap",
"sha2",

View File

@@ -1,4 +1,4 @@
Copyright © 2024 RamiusLr
Copyright © 2024-2025 RamiusLr
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@@ -8,18 +8,22 @@ This may be for you: `bak myfile`
# Options
```console
Usage: bak [OPTIONS] <FILENAME>
Usage: bak [FILE] [COMMAND]
Commands:
res
del
help Print this message or the help of the given subcommand(s)
Arguments:
<FILENAME> Specify the filename to backup
[FILE] File to backup (used if no subcommand is provided)
Options:
-d, --delete Add this flag to delete the backup file
-h, --help Print help
-V, --version Print version
```
# License
```console
MIT License Copyright (c) 2024 ramiuslr
MIT License Copyright (c) 2024-2025 ramiuslr
```

View File

@@ -4,8 +4,8 @@ use std::path::PathBuf;
use std::process;
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Opts {
#[command(name = "bak-rs", version, about, long_about = None)]
struct Args {
/// Optional subcommand (restore or delete). Default is backup
#[command(subcommand)]
command: Option<Commands>,
@@ -21,7 +21,7 @@ enum Commands {
}
fn main() {
let opts = Opts::parse();
let opts = Args::parse();
let result = match opts.command {
Some(Commands::Res { file }) => restore_backup_file(&file),