]> git.bitcoin.ninja Git - ldk-sample/commitdiff
Semantically sort subheadings
authorChiru <48340051+ch1ru@users.noreply.github.com>
Mon, 31 Oct 2022 15:21:13 +0000 (15:21 +0000)
committerGitHub <noreply@github.com>
Mon, 31 Oct 2022 15:21:13 +0000 (15:21 +0000)
src/cli.rs

index 8dbba3d31b0f5af1eabf095da2fc73b13d361d75..d53b74bbd98609279923b3b104639f3d4b8a1f68 100644 (file)
@@ -474,20 +474,33 @@ pub(crate) async fn poll_for_user_input<E: EventHandler>(
 }
 
 fn help() {
-       println!("openchannel pubkey@host:port <amt_satoshis> [--public]");
-       println!("sendpayment <invoice>");
-       println!("keysend <dest_pubkey> <amt_msats>");
-       println!("getinvoice <amt_msats> <expiry_secs>");
-       println!("connectpeer pubkey@host:port");
-       println!("listchannels");
-       println!("listpayments");
-       println!("closechannel <channel_id> <peer_pubkey>");
-       println!("forceclosechannel <channel_id> <peer_pubkey>");
-       println!("nodeinfo");
-       println!("listpeers");
-       println!("signmessage <message>");
-       println!("sendonionmessage <node_id_1,node_id_2,..,destination_node_id>");
-       println!("quit")
+       let package_version = env!("CARGO_PKG_VERSION");
+       let package_name = env!("CARGO_PKG_NAME");
+       println!("\nVERSION:");
+       println!("  {} v{}", package_name, package_version);
+       println!("\nUSAGE:");
+       println!("  Command [arguments]");
+       println!("\nCOMMANDS:");
+       println!("  help\tShows a list of commands.");
+       println!("  quit\tClose the application.");
+       println!("\n  Channels:");
+       println!("      openchannel pubkey@host:port <amt_satoshis> [--public]");
+       println!("      closechannel <channel_id> <peer_pubkey>");
+       println!("      forceclosechannel <channel_id> <peer_pubkey>");
+       println!("      listchannels");
+       println!("\n  Peers:");
+       println!("      connectpeer pubkey@host:port");
+       println!("      listpeers");
+       println!("\n  Payments:");
+       println!("      sendpayment <invoice>");
+       println!("      keysend <dest_pubkey> <amt_msats>");
+       println!("      listpayments");
+       println!("\n  Invoices:");
+       println!("      getinvoice <amt_msats> <expiry_secs>");
+       println!("\n  Other:");
+       println!("      signmessage <message>");
+       println!("      sendonionmessage <node_id_1,node_id_2,..,destination_node_id>");
+       println!("      nodeinfo");
 }
 
 fn node_info(channel_manager: &Arc<ChannelManager>, peer_manager: &Arc<PeerManager>) {