1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use clap::Parser;
use super::DeviceCommands;
#[derive(Parser, Debug)]
pub enum LocalCommand {
#[clap(flatten)]
DeviceCommands(DeviceCommands),
#[clap(flatten)]
LocalDeviceCommand(LocalDeviceCommand),
}
#[derive(Parser, Debug)]
pub enum LocalDeviceCommand {
/// List available server features.
HostFeatures,
/// Get logs of device
Logcat {
/// Path to output file (created if not exists)
path: Option<String>,
},
/// Forward a local port to a device port.
#[clap(subcommand)]
Forward(ForwardCommand),
/// Reverse a device port to a local port.
#[clap(subcommand)]
Reverse(ReverseCommand),
}
#[derive(Parser, Debug)]
pub enum ForwardCommand {
/// Remove all forwarded ports.
RemoveAll,
/// Remove a specific forwarded port.
Remove { local: String },
/// Forward a local port to a device port.
Add { local: String, remote: String },
}
#[derive(Parser, Debug)]
pub enum ReverseCommand {
/// Remove all reversed ports.
RemoveAll,
/// Remove a specific reversed port.
Remove { local: String },
/// Reverse a device port to a local port.
Add { remote: String, local: String },
}