diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-04-25 16:32:41 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-04-25 16:32:41 +0000 |
commit | 491396ae87d5f0061c7f5da9f404d988f4e16bac (patch) | |
tree | 3dd6e59954434782941c5cca4d0562e4041777b6 /src/opt.rs | |
parent | 4305a22cd719ec1aaadb46796bbd7fc84f2161f0 (diff) | |
parent | 398f412253d9a9c00ba7fc4dfc48591a8c17789b (diff) | |
download | jt2-491396ae87d5f0061c7f5da9f404d988f4e16bac.tar.gz |
Merge branch 'clap3' into 'main'
chore: port from structopt to clap v3
See merge request larswirzenius/jt!31
Diffstat (limited to 'src/opt.rs')
-rw-r--r-- | src/opt.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,26 +1,26 @@ //! Command line options. use crate::cmd; +use clap::Parser; use std::path::PathBuf; -use structopt::StructOpt; /// A parsed command line. -#[derive(Debug, StructOpt)] -#[structopt(about = "maintain a journal")] +#[derive(Debug, Parser)] +#[clap(about = "maintain a journal")] pub struct Opt { /// Global options, common for all subcommands. - #[structopt(flatten)] + #[clap(flatten)] pub global: GlobalOptions, /// The subcommand. - #[structopt(subcommand)] + #[clap(subcommand)] pub cmd: SubCommand, } /// Global options. /// /// These options are common to all subcommands. -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] pub struct GlobalOptions { /// Which configuration file to read. #[structopt(short, long, help = "Configuration file")] @@ -44,7 +44,7 @@ pub struct GlobalOptions { } /// A subcommand. -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] pub enum SubCommand { /// Show configuration. Config(cmd::Config), |