diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-10-02 10:50:35 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-10-23 09:38:00 +0300 |
commit | 5522e9c40a6b2beb1cfea51e90351b90fada5931 (patch) | |
tree | 201e4f57bf4d3240b02d5b34856c4bdbff8f1860 /src/cmd/restore.rs | |
parent | 1baa17c93e6cccd6194592076210625364058615 (diff) | |
download | obnam2-5522e9c40a6b2beb1cfea51e90351b90fada5931.tar.gz |
refactor: use clap instead of structopt
clap version 3 basically replaces structopt entirely.
Sponsored-by: author
Diffstat (limited to 'src/cmd/restore.rs')
-rw-r--r-- | src/cmd/restore.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs index 223d481..c4c06d2 100644 --- a/src/cmd/restore.rs +++ b/src/cmd/restore.rs @@ -9,6 +9,7 @@ use crate::dbgen::FileId; use crate::error::ObnamError; use crate::fsentry::{FilesystemEntry, FilesystemKind}; use crate::generation::{LocalGeneration, LocalGenerationError}; +use clap::Parser; use indicatif::{ProgressBar, ProgressStyle}; use libc::{chmod, mkfifo, timespec, utimensat, AT_FDCWD, AT_SYMLINK_NOFOLLOW}; use log::{debug, error, info}; @@ -20,19 +21,16 @@ use std::os::unix::fs::symlink; use std::os::unix::net::UnixListener; use std::path::StripPrefixError; use std::path::{Path, PathBuf}; -use structopt::StructOpt; use tempfile::NamedTempFile; use tokio::runtime::Runtime; /// Restore a backup. -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] pub struct Restore { /// Reference to generation to restore. - #[structopt()] gen_id: String, /// Path to directory where restored files are written. - #[structopt(parse(from_os_str))] to: PathBuf, } |