Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nicer format to pick. #ERABU-2 fixed
Signed-off-by: SitiSchu <admin@sitischu.com>
- Loading branch information
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
use colored::Colorize; | ||
|
||
use crate::collection::Collection; | ||
|
||
pub fn pick_item(collection_name: String) -> Result<(), Box<std::error::Error>> { | ||
pub fn pick_item(collection_name: String, no_format: bool) -> Result<(), Box<std::error::Error>> { | ||
let collection = Collection::new(&collection_name)?; | ||
println!("{}", collection.pick()); | ||
if no_format { | ||
println!("{}", collection.pick()); | ||
} else { | ||
println!("{} {}", "Picked item:".blue().bold(), collection.pick()); | ||
}; | ||
|
||
Ok(()) | ||
} |