mirror of
https://github.com/mimblewimble/mwixnet.git
synced 2025-01-20 19:11:09 +03:00
add option to output address to file
This commit is contained in:
parent
b66ee14ec5
commit
d75abc1c67
2 changed files with 19 additions and 2 deletions
|
@ -124,7 +124,17 @@ fn real_main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
config_path.to_string_lossy()
|
||||
);
|
||||
}
|
||||
println!("{}", server_config.onion_address());
|
||||
let sub_args = args.subcommand_matches("address").unwrap();
|
||||
if sub_args.is_present("output_file")
|
||||
{
|
||||
//output onion address to file
|
||||
let output_file = sub_args.value_of("output_file").unwrap();
|
||||
let onion_address = server_config.onion_address();
|
||||
std::fs::write(output_file, format!("{}", onion_address))?;
|
||||
println!("Onion address written to file: {}", output_file);
|
||||
} else {
|
||||
println!("{}", server_config.onion_address());
|
||||
}
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -50,4 +50,11 @@ subcommands:
|
|||
- init-config:
|
||||
about: Writes a new configuration file
|
||||
- address:
|
||||
about: Displays the public key of the server
|
||||
about: Outputs the public key of the server
|
||||
args:
|
||||
- output_file:
|
||||
help: Path to output the public key to
|
||||
long: output_file
|
||||
short: o
|
||||
takes_value: true
|
||||
required: false
|
Loading…
Reference in a new issue