Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
fn main() {

    // get action
    let mut action = String::from ("");
    let args: Vec<String> = env::args().collect();
    if args.len() > 1 {
        action = args.get(1).unwrap().to_lowercase().as_str();
    }

    match action.as_str() {
        "listDownloads" => {
            list_downloads();
        },
        "removeCompleted" => {
            remove_completed();
        },
        "download" => {
            download();
        }
        &_ => {
            show_usage();
        }
    }
}

...