diff options
Diffstat (limited to 'src/sub_commands')
| -rw-r--r-- | src/sub_commands/init.rs | 2 | ||||
| -rw-r--r-- | src/sub_commands/login.rs | 2 | ||||
| -rw-r--r-- | src/sub_commands/push.rs | 2 | ||||
| -rw-r--r-- | src/sub_commands/send.rs | 11 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/sub_commands/init.rs b/src/sub_commands/init.rs index ba188c9..bb437a5 100644 --- a/src/sub_commands/init.rs +++ b/src/sub_commands/init.rs | |||
| @@ -89,6 +89,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 89 | &cli_args.password, | 89 | &cli_args.password, |
| 90 | Some(&client), | 90 | Some(&client), |
| 91 | false, | 91 | false, |
| 92 | false, | ||
| 92 | ) | 93 | ) |
| 93 | .await?; | 94 | .await?; |
| 94 | 95 | ||
| @@ -330,6 +331,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 330 | user_ref.relays.write(), | 331 | user_ref.relays.write(), |
| 331 | relays.clone(), | 332 | relays.clone(), |
| 332 | !cli_args.disable_cli_spinners, | 333 | !cli_args.disable_cli_spinners, |
| 334 | false, | ||
| 333 | ) | 335 | ) |
| 334 | .await?; | 336 | .await?; |
| 335 | 337 | ||
diff --git a/src/sub_commands/login.rs b/src/sub_commands/login.rs index 77fecdd..8a3788f 100644 --- a/src/sub_commands/login.rs +++ b/src/sub_commands/login.rs | |||
| @@ -25,6 +25,7 @@ pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { | |||
| 25 | &args.password, | 25 | &args.password, |
| 26 | None, | 26 | None, |
| 27 | true, | 27 | true, |
| 28 | false, | ||
| 28 | ) | 29 | ) |
| 29 | .await?; | 30 | .await?; |
| 30 | Ok(()) | 31 | Ok(()) |
| @@ -42,6 +43,7 @@ pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { | |||
| 42 | &args.password, | 43 | &args.password, |
| 43 | Some(&client), | 44 | Some(&client), |
| 44 | true, | 45 | true, |
| 46 | false, | ||
| 45 | ) | 47 | ) |
| 46 | .await?; | 48 | .await?; |
| 47 | client.disconnect().await?; | 49 | client.disconnect().await?; |
diff --git a/src/sub_commands/push.rs b/src/sub_commands/push.rs index 56927fe..7a82c7a 100644 --- a/src/sub_commands/push.rs +++ b/src/sub_commands/push.rs | |||
| @@ -178,6 +178,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 178 | &cli_args.password, | 178 | &cli_args.password, |
| 179 | Some(&client), | 179 | Some(&client), |
| 180 | false, | 180 | false, |
| 181 | false, | ||
| 181 | ) | 182 | ) |
| 182 | .await?; | 183 | .await?; |
| 183 | 184 | ||
| @@ -212,6 +213,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 212 | user_ref.relays.write(), | 213 | user_ref.relays.write(), |
| 213 | repo_ref.relays.clone(), | 214 | repo_ref.relays.clone(), |
| 214 | !cli_args.disable_cli_spinners, | 215 | !cli_args.disable_cli_spinners, |
| 216 | false, | ||
| 215 | ) | 217 | ) |
| 216 | .await?; | 218 | .await?; |
| 217 | 219 | ||
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 07eb343..f10d2d3 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -3,7 +3,7 @@ use std::{path::Path, str::FromStr, time::Duration}; | |||
| 3 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{bail, Context, Result}; |
| 4 | use console::Style; | 4 | use console::Style; |
| 5 | use futures::future::join_all; | 5 | use futures::future::join_all; |
| 6 | use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; | 6 | use indicatif::{MultiProgress, ProgressBar, ProgressDrawTarget, ProgressStyle}; |
| 7 | use nostr::{ | 7 | use nostr::{ |
| 8 | nips::{ | 8 | nips::{ |
| 9 | nip01::Coordinate, | 9 | nip01::Coordinate, |
| @@ -195,6 +195,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re | |||
| 195 | &cli_args.password, | 195 | &cli_args.password, |
| 196 | Some(&client), | 196 | Some(&client), |
| 197 | false, | 197 | false, |
| 198 | false, | ||
| 198 | ) | 199 | ) |
| 199 | .await?; | 200 | .await?; |
| 200 | 201 | ||
| @@ -244,6 +245,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re | |||
| 244 | user_ref.relays.write(), | 245 | user_ref.relays.write(), |
| 245 | repo_ref.relays.clone(), | 246 | repo_ref.relays.clone(), |
| 246 | !cli_args.disable_cli_spinners, | 247 | !cli_args.disable_cli_spinners, |
| 248 | false, | ||
| 247 | ) | 249 | ) |
| 248 | .await?; | 250 | .await?; |
| 249 | 251 | ||
| @@ -285,6 +287,7 @@ pub async fn send_events( | |||
| 285 | my_write_relays: Vec<String>, | 287 | my_write_relays: Vec<String>, |
| 286 | repo_read_relays: Vec<String>, | 288 | repo_read_relays: Vec<String>, |
| 287 | animate: bool, | 289 | animate: bool, |
| 290 | silent: bool, | ||
| 288 | ) -> Result<()> { | 291 | ) -> Result<()> { |
| 289 | let fallback = [ | 292 | let fallback = [ |
| 290 | client.get_fallback_relays().clone(), | 293 | client.get_fallback_relays().clone(), |
| @@ -327,7 +330,11 @@ pub async fn send_events( | |||
| 327 | } | 330 | } |
| 328 | } | 331 | } |
| 329 | 332 | ||
| 330 | let m = MultiProgress::new(); | 333 | let m = if silent { |
| 334 | MultiProgress::with_draw_target(ProgressDrawTarget::hidden()) | ||
| 335 | } else { | ||
| 336 | MultiProgress::new() | ||
| 337 | }; | ||
| 331 | let pb_style = ProgressStyle::with_template(if animate { | 338 | let pb_style = ProgressStyle::with_template(if animate { |
| 332 | " {spinner} {prefix} {bar} {pos}/{len} {msg}" | 339 | " {spinner} {prefix} {bar} {pos}/{len} {msg}" |
| 333 | } else { | 340 | } else { |