Skip to content

Commit

Permalink
Write comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAwiteb committed Feb 27, 2023
1 parent 0964360 commit 7e0782d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ fn help() {
}

fn try_main() -> data2sound::Result<()> {
// Skip the first argument, which is the path to the executable
let args: Vec<String> = env::args().collect();
if args.iter().any(|arg| arg == "--version" || arg == "-v") {
version()
} else if args.iter().any(|arg| arg == "--help" || arg == "-h") || args.len() < 4 {
help()
} else {
// Skip the first argument, which is the path to the executable
let mut args = args.iter().skip(1);
// The `unwrap` is safe because we already checked that there are at least 4 arguments
let command = args.next().unwrap();
let input = args.next().unwrap();
let output = args.next().unwrap();
Expand Down

0 comments on commit 7e0782d

Please sign in to comment.