Skip to content

Commit ae8f7bf

Browse files
committed
feat(sync): assume sync subcommand if none given
1 parent 6a93563 commit ae8f7bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

aw-sync/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ mod util;
3131
#[clap(version = "0.1", author = "Erik Bjäreholt")]
3232
struct Opts {
3333
#[clap(subcommand)]
34-
command: Commands,
34+
command: Option<Commands>,
3535

3636
/// Host of instance to connect to.
3737
#[clap(long, default_value = "127.0.0.1")]
@@ -124,7 +124,8 @@ fn main() -> Result<(), Box<dyn Error>> {
124124

125125
let client = AwClient::new(&opts.host, port, "aw-sync")?;
126126

127-
match opts.command {
127+
// if opts.command is None, then we're using the default subcommand (Sync)
128+
match opts.command.unwrap_or(Commands::Sync { host: None }) {
128129
// Perform basic sync
129130
Commands::Sync { host } => {
130131
// Pull

0 commit comments

Comments
 (0)