Skip to content

Commit fc639bf

Browse files
committed
Start subcommand acts like restart when missing arg
1 parent 380ef6c commit fc639bf

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repository = "https://github.com/chdsbd/doug"
55
documentation = "https://github.com/chdsbd/doug/blob/master/README.md"
66
readme="README.md"
77
license = "MIT"
8-
version = "1.6.0"
8+
version = "1.7.0"
99
authors = ["Christopher Dignam <chris@dignam.xyz>"]
1010

1111
[dependencies]

src/main.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ fn main() {
5858
.subcommand(
5959
SubCommand::with_name("start")
6060
.about("Track new or existing project")
61-
.arg(
62-
Arg::with_name("project")
63-
.help("project to track")
64-
.required(true),
65-
),
61+
.arg(Arg::with_name("project").help(
62+
"project to track. If missing, start subcommand behaves like restart.",
63+
)),
6664
)
6765
.subcommand(
6866
SubCommand::with_name("status")
@@ -197,6 +195,9 @@ fn main() {
197195
time_periods.clone(),
198196
save_periods,
199197
);
198+
} else {
199+
// Restart last project if not argument is provided
200+
restart(&time_periods, save_periods);
200201
}
201202
}
202203

0 commit comments

Comments
 (0)