fixes #4
This commit is contained in:
		@@ -129,7 +129,9 @@ pub fn get(book: &str, chap_and_ver: &str, bibles: Vec<&Bible>) -> Result<String
 | 
				
			|||||||
        .collect::<Vec<(usize, &&str)>>();
 | 
					        .collect::<Vec<(usize, &&str)>>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let (book_idx, book_name) = match res.len() {
 | 
					    let (book_idx, book_name) = match res.len() {
 | 
				
			||||||
 | 
					        // there is one option for what book it is
 | 
				
			||||||
        1 => res[0],
 | 
					        1 => res[0],
 | 
				
			||||||
 | 
					        // there are >1 options for what book it is
 | 
				
			||||||
        2.. => {
 | 
					        2.. => {
 | 
				
			||||||
            eprintln!("Err: Ambigious input '{book}', could be any of:");
 | 
					            eprintln!("Err: Ambigious input '{book}', could be any of:");
 | 
				
			||||||
            for (_, i) in &res {
 | 
					            for (_, i) in &res {
 | 
				
			||||||
@@ -180,12 +182,15 @@ pub fn get(book: &str, chap_and_ver: &str, bibles: Vec<&Bible>) -> Result<String
 | 
				
			|||||||
                (Some(sn), Some(en)) => {
 | 
					                (Some(sn), Some(en)) => {
 | 
				
			||||||
                    if let (Ok(start), Ok(end)) = (sn.parse::<usize>(), en.parse::<usize>()) {
 | 
					                    if let (Ok(start), Ok(end)) = (sn.parse::<usize>(), en.parse::<usize>()) {
 | 
				
			||||||
                        let mut buf = String::new();
 | 
					                        let mut buf = String::new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        let translation = &chapters[0].0.translation_name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        buf += &format!("{style_bold}[{translation}] {style_underline}{book_name}:{start}-{end}{style_reset}\n");
 | 
				
			||||||
                        for num in start..=end {
 | 
					                        for num in start..=end {
 | 
				
			||||||
                            for (bible, _book, chapter) in &chapters {
 | 
					                            for (_, _, chapter) in &chapters {
 | 
				
			||||||
                                if let Some(verse) = chapter.get_verse_by_index(num) {
 | 
					                                if let Some(verse) = chapter.get_verse_by_index(num) {
 | 
				
			||||||
                                    buf += &format!(
 | 
					                                    buf += &format!(
 | 
				
			||||||
                                        "{style_bold}[{}] {style_underline}{book_name} {}:{}{style_reset}: {verse}\n",
 | 
					                                        "{}: {verse}\n", verse.number
 | 
				
			||||||
                                        bible.translation_name, chapter.number, verse.number
 | 
					 | 
				
			||||||
                                    );
 | 
					                                    );
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user