settings.rs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. use serde::Deserialize;
  2. use structopt::StructOpt;
  3. use structopt_toml::StructOptToml;
  4. use url::Url;
  5. use darkfi::net::settings::SettingsOpt;
  6. pub const CONFIG_FILE: &str = "taud_config.toml";
  7. pub const CONFIG_FILE_CONTENTS: &str = include_str!("../../taud_config.toml");
  8. /// taud cli
  9. #[derive(Clone, Debug, Deserialize, StructOpt, StructOptToml)]
  10. #[serde(default)]
  11. #[structopt(name = "taud")]
  12. pub struct Args {
  13. /// Sets a custom config file
  14. #[structopt(long)]
  15. pub config: Option<String>,
  16. /// JSON-RPC listen URL
  17. #[structopt(long = "rpc", default_value = "tcp://127.0.0.1:23330")]
  18. pub rpc_listen: Url,
  19. /// Sets Datastore Path
  20. #[structopt(long, default_value = "~/.tau")]
  21. pub datastore: String,
  22. #[structopt(flatten)]
  23. pub net: SettingsOpt,
  24. /// Increase verbosity
  25. #[structopt(short, parse(from_occurrences))]
  26. pub verbose: u8,
  27. /// Generate a new workspace
  28. #[structopt(long)]
  29. pub generate: bool,
  30. /// Secret Key To Encrypt/Decrypt tasks
  31. #[structopt(long)]
  32. pub workspaces: Vec<String>,
  33. /// Clean all the local data in datastore path
  34. /// (BE CAREFULL) Check the datastore path in the config file before running this
  35. #[structopt(long)]
  36. pub refresh: bool,
  37. /// Current display name
  38. #[structopt(long)]
  39. pub nickname: Option<String>,
  40. }