@@ -12,13 +12,14 @@ pub const DEFAULT_ALICE_PEER_ID: &str = "12D3KooWCdMKjesXMJz1SiZ7HgotrxuqhQJbP5s
12
12
pub const DEFAULT_STAGENET_MONERO_DAEMON_HOST : & str = "monero-stagenet.exan.tech" ;
13
13
14
14
#[ derive( structopt:: StructOpt , Debug ) ]
15
+ #[ structopt( name = "xmr-btc-swap" , about = "Atomically swap BTC for XMR" ) ]
15
16
pub struct Arguments {
16
17
#[ structopt(
17
18
long = "config" ,
18
19
help = "Provide a custom path to the configuration file. The configuration file must be a toml file." ,
19
20
parse( from_os_str)
20
21
) ]
21
- pub config : Option < PathBuf > ,
22
+ pub file_path : Option < PathBuf > ,
22
23
23
24
#[ structopt( long, help = "Activate debug logging." ) ]
24
25
pub debug : bool ,
@@ -28,35 +29,48 @@ pub struct Arguments {
28
29
}
29
30
30
31
#[ derive( structopt:: StructOpt , Debug ) ]
31
- #[ structopt( name = "xmr_btc-swap" , about = "XMR BTC atomic swap" ) ]
32
32
pub enum Command {
33
+ /// Start a XMR for BTC swap
33
34
BuyXmr {
34
35
#[ structopt( flatten) ]
35
- connect_params : ConnectParams ,
36
+ connect_params : AliceConnectParams ,
36
37
37
38
#[ structopt( flatten) ]
38
39
monero_params : MoneroParams ,
39
40
} ,
41
+ /// Show a list of past ongoing and completed swaps
40
42
History ,
43
+ /// Resume a swap
41
44
Resume {
42
- #[ structopt( long = "swap-id" ) ]
45
+ #[ structopt(
46
+ long = "swap-id" ,
47
+ help = "The swap id can be retrieved using the history subcommand"
48
+ ) ]
43
49
swap_id : Uuid ,
44
50
45
51
#[ structopt( flatten) ]
46
- connect_params : ConnectParams ,
52
+ connect_params : AliceConnectParams ,
47
53
48
54
#[ structopt( flatten) ]
49
55
monero_params : MoneroParams ,
50
56
} ,
57
+ /// Try to cancel an ongoing swap (expert users only)
51
58
Cancel {
52
- #[ structopt( long = "swap-id" ) ]
59
+ #[ structopt(
60
+ long = "swap-id" ,
61
+ help = "The swap id can be retrieved using the history subcommand"
62
+ ) ]
53
63
swap_id : Uuid ,
54
64
55
65
#[ structopt( short, long) ]
56
66
force : bool ,
57
67
} ,
68
+ /// Try to cancel a swap and refund my BTC (expert users only)
58
69
Refund {
59
- #[ structopt( long = "swap-id" ) ]
70
+ #[ structopt(
71
+ long = "swap-id" ,
72
+ help = "The swap id can be retrieved using the history subcommand"
73
+ ) ]
60
74
swap_id : Uuid ,
61
75
62
76
#[ structopt( short, long) ]
@@ -65,25 +79,34 @@ pub enum Command {
65
79
}
66
80
67
81
#[ derive( structopt:: StructOpt , Debug ) ]
68
- pub struct ConnectParams {
69
- #[ structopt( long = "connect-peer-id" , default_value = DEFAULT_ALICE_PEER_ID ) ]
70
- pub alice_peer_id : PeerId ,
82
+ pub struct AliceConnectParams {
83
+ #[ structopt(
84
+ long = "seller-peer-id" ,
85
+ default_value = DEFAULT_ALICE_PEER_ID ,
86
+ help = "The peer id of a specific swap partner can be optionally provided"
87
+ ) ]
88
+ pub peer_id : PeerId ,
71
89
72
90
#[ structopt(
73
- long = "connect-addr" ,
74
- default_value = DEFAULT_ALICE_MULTIADDR
91
+ long = "seller-addr" ,
92
+ default_value = DEFAULT_ALICE_MULTIADDR ,
93
+ help = "The multiaddr of a specific swap partner can be optionally provided"
75
94
) ]
76
- pub alice_addr : Multiaddr ,
95
+ pub multiaddr : Multiaddr ,
77
96
}
78
97
79
98
#[ derive( structopt:: StructOpt , Debug ) ]
80
99
pub struct MoneroParams {
81
- #[ structopt( long = "receive-address" , parse( try_from_str = parse_monero_address) ) ]
100
+ #[ structopt( long = "receive-address" ,
101
+ help = "Provide the monero address where you would like to receive monero" ,
102
+ parse( try_from_str = parse_monero_address)
103
+ ) ]
82
104
pub receive_monero_address : monero:: Address ,
83
105
84
106
#[ structopt(
85
- long = "monero-daemon-host" ,
86
- default_value = DEFAULT_STAGENET_MONERO_DAEMON_HOST
107
+ long = "monero-daemon-host" ,
108
+ help = "Specify to connect to a monero daemon of your choice" ,
109
+ default_value = DEFAULT_STAGENET_MONERO_DAEMON_HOST
87
110
) ]
88
111
pub monero_daemon_host : String ,
89
112
}
0 commit comments