summaryrefslogtreecommitdiff
path: root/src/cmd/chunk.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-02 10:50:35 +0300
committerLars Wirzenius <liw@liw.fi>2022-10-23 09:38:00 +0300
commit5522e9c40a6b2beb1cfea51e90351b90fada5931 (patch)
tree201e4f57bf4d3240b02d5b34856c4bdbff8f1860 /src/cmd/chunk.rs
parent1baa17c93e6cccd6194592076210625364058615 (diff)
downloadobnam2-5522e9c40a6b2beb1cfea51e90351b90fada5931.tar.gz
refactor: use clap instead of structopt
clap version 3 basically replaces structopt entirely. Sponsored-by: author
Diffstat (limited to 'src/cmd/chunk.rs')
-rw-r--r--src/cmd/chunk.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cmd/chunk.rs b/src/cmd/chunk.rs
index 445d23f..293de20 100644
--- a/src/cmd/chunk.rs
+++ b/src/cmd/chunk.rs
@@ -5,22 +5,19 @@ use crate::chunkmeta::ChunkMeta;
use crate::cipher::CipherEngine;
use crate::config::ClientConfig;
use crate::error::ObnamError;
+use clap::Parser;
use std::path::PathBuf;
-use structopt::StructOpt;
/// Encrypt a chunk.
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct EncryptChunk {
/// The name of the file containing the cleartext chunk.
- #[structopt(parse(from_os_str))]
filename: PathBuf,
/// Name of file where to write the encrypted chunk.
- #[structopt(parse(from_os_str))]
output: PathBuf,
/// Chunk metadata as JSON.
- #[structopt()]
json: String,
}
@@ -43,18 +40,15 @@ impl EncryptChunk {
}
/// Decrypt a chunk.
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct DecryptChunk {
/// Name of file containing encrypted chunk.
- #[structopt(parse(from_os_str))]
filename: PathBuf,
/// Name of file where to write the cleartext chunk.
- #[structopt(parse(from_os_str))]
output: PathBuf,
/// Chunk metadata as JSON.
- #[structopt()]
json: String,
}