summaryrefslogtreecommitdiff
path: root/src/bin/subplot.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-12-01 06:39:48 +0000
committerLars Wirzenius <liw@liw.fi>2022-12-01 06:39:48 +0000
commite9cb02bbfc6c1ff5321abfaaf1275dd301423b75 (patch)
tree64ecd8b3a2e6a36e34882ef93dcfcb5dfa148bd5 /src/bin/subplot.rs
parentb65b621b7215d1873df9dce11f195d9bbd68ebe4 (diff)
parentfb48f92c8092c5b9de8e15c0cb477efd1b7a6785 (diff)
downloadsubplot-e9cb02bbfc6c1ff5321abfaaf1275dd301423b75.tar.gz
Merge branch 'clap4' into 'main'
(chore): Update to clap4 Closes #310 See merge request subplot/subplot!303
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r--src/bin/subplot.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs
index 8ede58d..b86c613 100644
--- a/src/bin/subplot.rs
+++ b/src/bin/subplot.rs
@@ -136,13 +136,7 @@ struct Extract {
merciful: bool,
/// Directory to write extracted files to
- #[clap(
- name = "DIR",
- long = "directory",
- short = 'd',
- parse(from_os_str),
- default_value = "."
- )]
+ #[clap(name = "DIR", long = "directory", short = 'd', default_value = ".")]
directory: PathBuf,
/// Don't actually write the files out
@@ -150,7 +144,6 @@ struct Extract {
dry_run: bool,
/// Input subplot document filename
- #[clap(parse(from_os_str))]
filename: PathBuf,
/// Names of embedded files to be extracted.
@@ -202,11 +195,10 @@ struct Metadata {
merciful: bool,
/// Form that you want the output to take
- #[clap(short = 'o', default_value = "plain", possible_values=&["plain", "json"])]
+ #[clap(short = 'o', default_value = "plain")]
output_format: cli::OutputFormat,
/// Input subplot document filename
- #[clap(parse(from_os_str))]
filename: PathBuf,
}
@@ -242,11 +234,10 @@ struct Docgen {
template: Option<String>,
// Input Subplot document
- #[clap(parse(from_os_str))]
input: PathBuf,
// Output document filename
- #[clap(name = "FILE", long = "output", short = 'o', parse(from_os_str))]
+ #[clap(name = "FILE", long = "output", short = 'o')]
output: PathBuf,
// Set date.
@@ -358,16 +349,10 @@ struct Codegen {
template: Option<String>,
/// Input filename.
- #[clap(parse(from_os_str))]
filename: PathBuf,
/// Write generated test program to this file.
- #[clap(
- long,
- short,
- parse(from_os_str),
- help = "Writes generated test program to FILE"
- )]
+ #[clap(long, short, help = "Writes generated test program to FILE")]
output: PathBuf,
/// Run the generated test program after writing it?
@@ -456,7 +441,7 @@ fn real_main() {
info!("Starting Subplot");
let argparser = Toplevel::command();
let version = long_version().unwrap();
- let argparser = argparser.long_version(version.as_str());
+ let argparser = argparser.long_version(version);
let args = argparser.get_matches();
let args = Toplevel::from_arg_matches(&args).unwrap();
args.handle_special_args();