You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. use clap::Parser;
  2. use once_cell::sync::Lazy;
  3. #[derive(Parser)]
  4. #[clap(name = "queuectl")]
  5. #[clap(version = "1.0")]
  6. pub struct Cli {
  7. #[clap(short, long)]
  8. /// Input path. Can be a file or a url that starts with http:// or https://.
  9. pub input: String,
  10. #[clap(short, long)]
  11. /// Tracker slug for the project.
  12. pub project: String,
  13. #[clap(short, long, default_value = "todo")]
  14. /// The queue where items will be queued into.
  15. pub queue: String,
  16. #[clap(long, default_value = "8192")]
  17. /// How many items to send per SADD command.
  18. pub chunk_size: usize,
  19. #[clap(short, long, default_value = "redis://127.0.0.1/", env = "TRACKER_REDIS_URL")]
  20. /// URL of the redis to connect to.
  21. pub redis: String,
  22. #[clap(long, short, default_value = "auto", arg_enum)]
  23. /// Specify the compression of the input file. By default will autodetect by file extension.
  24. pub compression: crate::compression::CompressionMode,
  25. #[clap(long, default_value = "32")]
  26. /// How many commands to pipeline into redis.
  27. pub pipeline_size: usize,
  28. #[clap(long)]
  29. /// Do not show a progress bar.
  30. pub no_progressbar: bool,
  31. }
  32. pub static ARGS: Lazy<Cli> = Lazy::new(|| Cli::parse());