From 5ee50ac4df42cfb5908fa6d54c4973c0446a7dde Mon Sep 17 00:00:00 2001 From: Bryce Berger Date: Sun, 5 Mar 2023 13:17:30 -0500 Subject: [PATCH] Add args_override_self --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 87822caf..0c53864d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::process::ExitCode; -use clap::Parser; +use clap::{CommandFactory, FromArgMatches}; use cli::Clargs; use fs::erdtree::{self, tree::Tree}; @@ -25,9 +25,10 @@ fn main() -> ExitCode { ExitCode::SUCCESS } -fn run() -> Result<(), fs::error::Error> { +fn run() -> Result<(), Box> { erdtree::tree::ui::init(); - let clargs = Clargs::parse(); + let matches = Clargs::command().args_override_self(true).get_matches(); + let clargs = Clargs::from_arg_matches(&matches)?; let tree = Tree::try_from(clargs)?; println!("{tree}");