From 6dd107f4d42bc2e5fab6adbb0bb2f818c2503430 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Sat, 9 Apr 2022 09:53:52 +0400 Subject: [PATCH] bin/tau-cli: add listen command for cli --- bin/tau-cli/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/tau-cli/src/main.rs b/bin/tau-cli/src/main.rs index 15ea81914..a1b781d14 100644 --- a/bin/tau-cli/src/main.rs +++ b/bin/tau-cli/src/main.rs @@ -3,6 +3,7 @@ use std::{ fs::{self, File}, io, io::{Read, Write}, + net::SocketAddr, ops::Index, process::Command, }; @@ -112,6 +113,9 @@ pub struct CliTau { /// Increase verbosity #[clap(short, parse(from_occurrences))] pub verbose: u8, + /// Rpc address + #[clap(long, default_value = "127.0.0.1:8875")] + pub listen: SocketAddr, #[clap(subcommand)] pub command: Option, } @@ -235,7 +239,9 @@ async fn show(url: &str, id: u64) -> Result { } async fn start(options: CliTau) -> Result<()> { - let rpc_addr = "tcp://127.0.0.1:8875"; + // FIXME + let rpc_addr = &format!("tcp://{}", options.listen.to_string()); + match options.command { Some(CliTauSubCommands::Add { title, desc, assign, project, due, rank }) => { let title = if title.is_none() {