diff --git a/src/main.rs b/src/main.rs index 26db63c..557992f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,6 +40,10 @@ fn main() { 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() { panic!("invalid index"); } @@ -61,6 +65,10 @@ fn main() { println!("changed"); } 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() { panic!("invalid index"); } @@ -110,6 +118,10 @@ fn main() { idx: target_idx, 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() { panic!("invalid index"); }