Skip to content

Commit

Permalink
Merge pull request #1307 from Myriad-Dreamin/fix-path-value-parser
Browse files Browse the repository at this point in the history
Fix value parser for `Option<PathBuf>`
  • Loading branch information
drager committed Jun 21, 2023
2 parents 8baa0b9 + e1f5dfe commit c8dfdec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use self::publish::{access::Access, publish};
use self::test::{Test, TestOptions};
use crate::install::InstallMode;
use anyhow::Result;
use clap::builder::ValueParser;
use clap::Subcommand;
use log::info;
use std::path::PathBuf;
Expand All @@ -33,7 +32,7 @@ pub enum Command {
/// 🍱 create a tar of your npm package but don't publish!
Pack {
/// The path to the Rust crate. If not set, searches up the path from the current directory.
#[clap(value_parser = ValueParser::os_string())]
#[clap()]
path: Option<PathBuf>,
},

Expand Down Expand Up @@ -70,7 +69,7 @@ pub enum Command {
tag: Option<String>,

/// The path to the Rust crate. If not set, searches up the path from the current directory.
#[clap(value_parser = ValueParser::os_string())]
#[clap()]
path: Option<PathBuf>,
},

Expand Down
7 changes: 3 additions & 4 deletions src/command/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::manifest;
use crate::test::{self, webdriver};
use anyhow::{bail, Result};
use binary_install::Cache;
use clap::builder::ValueParser;
use clap::Args;
use console::style;
use log::info;
Expand All @@ -32,7 +31,7 @@ pub struct TestOptions {
/// copy.
pub firefox: bool,

#[clap(long = "geckodriver", value_parser = ValueParser::os_string())]
#[clap(long = "geckodriver")]
/// The path to the `geckodriver` WebDriver client for testing in
/// Firefox. Implies `--firefox`.
pub geckodriver: Option<PathBuf>,
Expand All @@ -44,7 +43,7 @@ pub struct TestOptions {
/// copy.
pub chrome: bool,

#[clap(long = "chromedriver", value_parser = ValueParser::os_string())]
#[clap(long = "chromedriver")]
/// The path to the `chromedriver` WebDriver client for testing in
/// Chrome. Implies `--chrome`.
pub chromedriver: Option<PathBuf>,
Expand All @@ -56,7 +55,7 @@ pub struct TestOptions {
/// download the `safaridriver` WebDriver client for you.
pub safari: bool,

#[clap(long = "safaridriver", value_parser = ValueParser::os_string())]
#[clap(long = "safaridriver")]
/// The path to the `safaridriver` WebDriver client for testing in
/// Safari. Implies `--safari`.
pub safaridriver: Option<PathBuf>,
Expand Down

0 comments on commit c8dfdec

Please sign in to comment.