We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a93563 commit ae8f7bfCopy full SHA for ae8f7bf
aw-sync/src/main.rs
@@ -31,7 +31,7 @@ mod util;
31
#[clap(version = "0.1", author = "Erik Bjäreholt")]
32
struct Opts {
33
#[clap(subcommand)]
34
- command: Commands,
+ command: Option<Commands>,
35
36
/// Host of instance to connect to.
37
#[clap(long, default_value = "127.0.0.1")]
@@ -124,7 +124,8 @@ fn main() -> Result<(), Box<dyn Error>> {
124
125
let client = AwClient::new(&opts.host, port, "aw-sync")?;
126
127
- match opts.command {
+ // if opts.command is None, then we're using the default subcommand (Sync)
128
+ match opts.command.unwrap_or(Commands::Sync { host: None }) {
129
// Perform basic sync
130
Commands::Sync { host } => {
131
// Pull
0 commit comments