Skip to content

Commit

Permalink
Update encode usage
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAwiteb committed Feb 27, 2023
1 parent 94f8e7c commit 1bd4d02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::{env, fs};

const HELP_MESSAGE: &str = r#"Usage: data2sound <command> <input> <output>
Commands:
encode, e Encode a file to a wav file
Expand All @@ -22,7 +20,7 @@ fn help() {
}

fn try_main() -> data2sound::Result<()> {
let args: Vec<String> = env::args().collect();
let args: Vec<String> = std::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 {
Expand All @@ -35,7 +33,7 @@ fn try_main() -> data2sound::Result<()> {
let input = args.next().unwrap();
let output = args.next().unwrap();
match command.as_str() {
"encode" | "e" => data2sound::encode(fs::File::open(input)?, output)?,
"encode" | "e" => data2sound::encode(input, output)?,
"decode" | "d" => data2sound::decode(input, output)?,
_ => eprintln!(
"Unknown command '{}' Run 'data2sound --help' for more information",
Expand Down

0 comments on commit 1bd4d02

Please sign in to comment.