Skip to content

Commit

Permalink
Merge pull request #48 from IkBenOlie5/develop
Browse files Browse the repository at this point in the history
Send a message if no shortcuts were found by quicknav ls
  • Loading branch information
MrDogeBro committed Mar 15, 2022
2 parents a8501ee + eeda62a commit 77faf3a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ pub fn list(shortcut: Option<String>) -> Result<i32> {
} else {
let config: config::Config = config::Config::load()?;

if config.shortcuts.is_empty() {
return Err(anyhow!(
"You haven't set up any shortcuts yet, get started with quicknav add."
));
}

let mut shortcut_list = Table::new();
shortcut_list.set_format(*format::consts::FORMAT_NO_BORDER_LINE_SEPARATOR);
shortcut_list.set_titles(row!["Name", "Shortcuts", "Shortcut Location"]);
Expand Down

0 comments on commit 77faf3a

Please sign in to comment.