Skip to content

Commit

Permalink
fix(cli/windows): fixed trailing slash cmd issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SalOne22 committed Mar 23, 2024
1 parent aa5e21c commit 88e6b92
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,22 @@ macro_rules! handle_error {
fn main() {
pretty_env_logger::init();

let matches = cli().get_matches();
let matches = cli().get_matches_from(
#[cfg(not(windows))]
{
std::env::args()
},
#[cfg(windows)]
{
std::env::args().map(|mut arg| {
if let Some(s) = arg.strip_suffix("\"") {
arg = s.to_string();
}

arg
})
},
);

match matches.subcommand() {
Some((subcommand, matches)) => {
Expand Down

0 comments on commit 88e6b92

Please sign in to comment.