add temporary limitation for managers subcommands
This commit is contained in:
parent
972aae9460
commit
92e4ae4dc2
1 changed files with 12 additions and 0 deletions
12
src/main.rs
12
src/main.rs
|
@ -40,6 +40,10 @@ fn main() {
|
||||||
link,
|
link,
|
||||||
no_link,
|
no_link,
|
||||||
} => {
|
} => {
|
||||||
|
if current_task_info.is_some() {
|
||||||
|
panic!("You can change priority only when you don't have an active task, yet");
|
||||||
|
}
|
||||||
|
|
||||||
if idx == 0 || idx > tasks.len() {
|
if idx == 0 || idx > tasks.len() {
|
||||||
panic!("invalid index");
|
panic!("invalid index");
|
||||||
}
|
}
|
||||||
|
@ -61,6 +65,10 @@ fn main() {
|
||||||
println!("changed");
|
println!("changed");
|
||||||
}
|
}
|
||||||
cli::SubCommand::Remove { idx } => {
|
cli::SubCommand::Remove { idx } => {
|
||||||
|
if current_task_info.is_some() {
|
||||||
|
panic!("You can change priority only when you don't have an active task, yet");
|
||||||
|
}
|
||||||
|
|
||||||
if idx == 0 || idx > tasks.len() {
|
if idx == 0 || idx > tasks.len() {
|
||||||
panic!("invalid index");
|
panic!("invalid index");
|
||||||
}
|
}
|
||||||
|
@ -110,6 +118,10 @@ fn main() {
|
||||||
idx: target_idx,
|
idx: target_idx,
|
||||||
priority,
|
priority,
|
||||||
} => {
|
} => {
|
||||||
|
if current_task_info.is_some() {
|
||||||
|
panic!("You can change priority only when you don't have an active task, yet");
|
||||||
|
}
|
||||||
|
|
||||||
if target_idx == 0 || target_idx > tasks.len() {
|
if target_idx == 0 || target_idx > tasks.len() {
|
||||||
panic!("invalid index");
|
panic!("invalid index");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue