Make --file optional for generate-node-key (#7043)

This pr makes the `--file` argument optional to `generate-node-key`.
If the argument is not given, the secret node key will be printed to
`stdout`. The public node key will always be printed to `stderr`.
This commit is contained in:
Bastian Köcher
2020-09-08 10:32:37 +02:00
committed by GitHub
parent 186fa587cf
commit ae0f7e58b0
3 changed files with 16 additions and 9 deletions
+3 -2
View File
@@ -28,10 +28,11 @@ use super::{
generate_node_key::GenerateNodeKeyCmd,
};
/// key utilities for the cli.
/// Key utilities for the cli.
#[derive(Debug, StructOpt)]
pub enum KeySubcommand {
/// Generate a random node libp2p key, save it to file and print its peer ID
/// Generate a random node libp2p key, save it to file or print it to stdout
/// and print its peer ID to stderr.
GenerateNodeKey(GenerateNodeKeyCmd),
/// Generate a random account