Skip to content

Commit

Permalink
src: cli: Fix path expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Jun 15, 2024
1 parent 7024015 commit eb6e2b0
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/cli/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,23 @@ pub fn mavlink_connection_string() -> String {
}

pub fn log_path() -> String {
MANAGER
.clap_matches
.log_path
.clone()
.expect("Clap arg \"log-path\" should always be \"Some(_)\" because of the default value.")
let log_path =
MANAGER.clap_matches.log_path.clone().expect(
"Clap arg \"log-path\" should always be \"Some(_)\" because of the default value.",
);

shellexpand::full(&log_path)
.expect("Failed to expand path")
.to_string()
}

// Return the desired settings file
pub fn settings_file() -> String {
MANAGER.clap_matches.settings_file.clone()
let settings_file = MANAGER.clap_matches.settings_file.clone();

shellexpand::full(&settings_file)
.expect("Failed to expand path")
.to_string()
}

// Return the desired address for the REST API
Expand Down

0 comments on commit eb6e2b0

Please sign in to comment.