Make things private if possible

This commit is contained in:
Thomas Eizinger 2021-07-07 12:29:21 +10:00 committed by Daniel Karzel
parent 91b0a0863b
commit 3b1789fe07
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E

View File

@ -246,37 +246,37 @@ pub enum Command {
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
#[structopt(name = "swap", about = "CLI for swapping BTC for XMR", author)] #[structopt(name = "swap", about = "CLI for swapping BTC for XMR", author)]
pub struct RawArguments { struct RawArguments {
// global is necessary to ensure that clap can match against testnet in subcommands // global is necessary to ensure that clap can match against testnet in subcommands
#[structopt( #[structopt(
long, long,
help = "Swap on testnet and assume testnet defaults for data-dir and the blockchain related parameters", help = "Swap on testnet and assume testnet defaults for data-dir and the blockchain related parameters",
global = true global = true
)] )]
pub testnet: bool, testnet: bool,
#[structopt( #[structopt(
long = "--data-dir", long = "--data-dir",
help = "Provide the data directory path to be used to store application data using testnet and mainnet as subfolder" help = "Provide the data directory path to be used to store application data using testnet and mainnet as subfolder"
)] )]
pub data: Option<PathBuf>, data: Option<PathBuf>,
#[structopt(long, help = "Activate debug logging.")] #[structopt(long, help = "Activate debug logging.")]
pub debug: bool, debug: bool,
#[structopt( #[structopt(
short, short,
long = "json", long = "json",
help = "Changes the log messages to json vs plain-text. This can be helpful to simplify automated log analyses." help = "Changes the log messages to json vs plain-text. This can be helpful to simplify automated log analyses."
)] )]
pub json: bool, json: bool,
#[structopt(subcommand)] #[structopt(subcommand)]
pub cmd: RawCommand, cmd: RawCommand,
} }
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
pub enum RawCommand { enum RawCommand {
/// Start a XMR for BTC swap /// Start a XMR for BTC swap
BuyXmr { BuyXmr {
#[structopt(flatten)] #[structopt(flatten)]
@ -355,52 +355,52 @@ pub enum RawCommand {
} }
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
pub struct Monero { struct Monero {
#[structopt( #[structopt(
long = "monero-daemon-address", long = "monero-daemon-address",
help = "Specify to connect to a monero daemon of your choice: <host>:<port>" help = "Specify to connect to a monero daemon of your choice: <host>:<port>"
)] )]
pub monero_daemon_address: Option<String>, monero_daemon_address: Option<String>,
} }
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
pub struct Bitcoin { struct Bitcoin {
#[structopt(long = "electrum-rpc", help = "Provide the Bitcoin Electrum RPC URL")] #[structopt(long = "electrum-rpc", help = "Provide the Bitcoin Electrum RPC URL")]
pub bitcoin_electrum_rpc_url: Option<Url>, bitcoin_electrum_rpc_url: Option<Url>,
#[structopt( #[structopt(
long = "bitcoin-target-block", long = "bitcoin-target-block",
help = "Use for fee estimation, decides within how many blocks the Bitcoin transactions should be confirmed." help = "Use for fee estimation, decides within how many blocks the Bitcoin transactions should be confirmed."
)] )]
pub bitcoin_target_block: Option<usize>, bitcoin_target_block: Option<usize>,
} }
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
pub struct Tor { struct Tor {
#[structopt( #[structopt(
long = "tor-socks5-port", long = "tor-socks5-port",
help = "Your local Tor socks5 proxy port", help = "Your local Tor socks5 proxy port",
default_value = DEFAULT_TOR_SOCKS5_PORT default_value = DEFAULT_TOR_SOCKS5_PORT
)] )]
pub tor_socks5_port: u16, tor_socks5_port: u16,
} }
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
pub struct SwapId { struct SwapId {
#[structopt( #[structopt(
long = "swap-id", long = "swap-id",
help = "The swap id can be retrieved using the history subcommand" help = "The swap id can be retrieved using the history subcommand"
)] )]
pub swap_id: Uuid, swap_id: Uuid,
} }
#[derive(structopt::StructOpt, Debug)] #[derive(structopt::StructOpt, Debug)]
pub struct Seller { struct Seller {
#[structopt( #[structopt(
long, long,
help = "The seller's address. Must include a peer ID part, i.e. `/p2p/`" help = "The seller's address. Must include a peer ID part, i.e. `/p2p/`"
)] )]
pub seller: Multiaddr, seller: Multiaddr,
} }
mod data { mod data {