diff --git a/src/cli/list_command.rs b/src/cli/list_command.rs index 578ea61..1035ac6 100644 --- a/src/cli/list_command.rs +++ b/src/cli/list_command.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use std::num::NonZeroU64; + use clap::Args; use comfy_table::Table; use regex::Regex; @@ -35,7 +37,7 @@ pub struct List { /// Return the password with spesifc index #[arg(short, long, value_name = "INDEX")] - get: Option, + get: Option, /// Search and display only matching passwords. /// /// The name and username will be searched. And service and note if included @@ -79,7 +81,7 @@ impl RunCommand for List { .enumerate() .filter(|(idx, pass)| { if let Some(index) = self.get { - return (idx + 1) == index; + return (idx + 1) == index.get() as usize; } if let Some(ref pattern) = self.search { if self.regex {