parse_args: cleanup
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -14,14 +14,8 @@ use viperus::Viperus;
|
||||
/// Parse the commandline arguments and preset default values
|
||||
/// Precedence: defaults -> config-file -> environment -> commandline
|
||||
pub fn parse_args(viperus: &mut Viperus) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if cfg!(feature = "global") {
|
||||
trace!(target: "Viperus", "Viperus feature 'global' enabled.");
|
||||
println!("Lasy static: 'VIPERUS' is accessible globaly");
|
||||
}
|
||||
|
||||
if cfg!(feature = "fmt-clap") {
|
||||
trace!(target: "Viperus", "Viperus feature 'fmt-clap' enabled.");
|
||||
println!("Using feature fmt-clap");
|
||||
if cfg!(feature = "parse_cli") {
|
||||
trace!(target: "Viperus", "Enabled parsing features.");
|
||||
}
|
||||
|
||||
if let Some(proj_dirs) = ProjectDirs::from("de", "Networkx GmbH", "advotracker") {
|
||||
@@ -29,7 +23,7 @@ pub fn parse_args(viperus: &mut Viperus) -> Result<(), Box<dyn std::error::Error
|
||||
// Lin: $HOME/.config/advotracker
|
||||
// Win: C:\Users\%USERNAME%\AppData\Roaming\Networkx GmbH\advotracker\config
|
||||
// Mac: /Users/$USER/Library/Application Support/de.Networkx-GmbH.advotracker
|
||||
trace!(target: "ProjectDirs", "Viperus feature 'fmt-clap' enabled.");
|
||||
trace!(target: "ProjectDirs", "Read from target-os defaults direcories.");
|
||||
}
|
||||
|
||||
if let Some(proj_dirs) = ProjectDirs::from("de", "Networkx GmbH", "advotracker") {
|
||||
@@ -199,11 +193,15 @@ SMR Unerledigt: 089 92529 60222",
|
||||
);
|
||||
println!(
|
||||
"to_email_address: {:?}",
|
||||
viperus.get::<String>("to_email_address").unwrap_or_default()
|
||||
viperus
|
||||
.get::<String>("to_email_address")
|
||||
.unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"from_email_address: {:?}",
|
||||
viperus.get::<String>("from_email_address").unwrap_or_default()
|
||||
viperus
|
||||
.get::<String>("from_email_address")
|
||||
.unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"test_policy_number: {:?}",
|
||||
|
||||
Reference in New Issue
Block a user