Add optional sorted listing of file contents

This commit is contained in:
2023-06-15 23:27:21 +02:00
parent 0f584997f7
commit 11b233b642
9 changed files with 68 additions and 8 deletions

View File

@@ -109,8 +109,11 @@ fn main() -> Result<(), Box<dyn Error>> {
let cli = Cli::parse();
match cli.command {
Command::List { inputfile } => {
let data = read_inputfile(inputfile)?;
Command::List { inputfile, sorted } => {
let mut data = read_inputfile(inputfile)?;
if sorted {
data.sorted()
}
data.print_list();
}
Command::Modify {