Skip to content

Commit

Permalink
Update directory to input
Browse files Browse the repository at this point in the history
  • Loading branch information
Spider committed Sep 18, 2023
1 parent c41dfb6 commit 5c13156
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@
The AudioInfo Generator is a command-line tool that generates an audioinfo file for a given directory containing FLAC files. This README provides an overview of the tool's functionality, usage, and command-line options.

# Usage
```audioinfo-generator [FLAGS] --directory <DIRECTORY> [--output <OUTPUT>] [--print]```
```audioinfo-generator [FLAGS] --input <DIRECTORY> [--output <OUTPUT>] [--print]```

* `--directory: Sets the directory to scan for FLAC files (required).`
* `--input: Sets the directory to scan for FLAC files (required).`

* `--output: Sets the output directory for the generated audioinfo file. If not provided, the audioinfo file will be saved in the current working directory with the name "audioinfo.txt".`

* `--print: If specified, the generated audioinfo content will be printed to the standard output instead of saving it to a file.`

* `--verbose or -v: Enables verbose (debug) output. This option can be used to get more detailed information during the execution of the tool.`
* `-h: Show help menu of the tool`

# Trailing slashes
Currently clap has a issue with trailing slashes on paths. So if you encounter a issue when trying to generate a file with a path such as
```.\audioinfo.exe -i 'H:\test\test\test_album\'```
```.\audioinfo.exe inputi 'H:\test\test\test_album\'```
Please remove the trailing slash as this causes clap to attach a ``"`` to the end
# Examples
## Generate an audioinfo file for a directory
```.\audioinfo.exe -i 'H:\test\test\test_album'
## Generate an audioinfo file for FLAC files in a specified directory and save it to a custom output file:
```audioinfo --directory /path/to/your/flac_files --output /path/to/output/audioinfo.txt```
```audioinfo --input /path/to/your/flac_files --output /path/to/output/audioinfo.txt```
## Generate an audioinfo file for FLAC files in a specified directory and print the content to the standard output:
```audioinfo-generator --directory /path/to/your/flac_files --print```
```audioinfo-generator --input /path/to/your/flac_files --print```
## Enable verbose (debug) output:
```audioinfo --directory /path/to/your/flac_files --verbose```
```audioinfo --input /path/to/your/flac_files --verbose```
4 changes: 2 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
.author("Spider")
.about("Generates an audioinfo file for the given directory")
.arg(
Arg::new("directory")
Arg::new("input")
.short('i')
.long("input")
.help("Sets the directory to scan for FLAC files")
Expand Down Expand Up @@ -47,7 +47,7 @@ fn main() {
.expect("Failed to set global default tracing subscriber");
}
let directory = matches
.get_one::<PathBuf>("directory")
.get_one::<PathBuf>("input")
.expect("required")
.clone();

Expand Down

0 comments on commit 5c13156

Please sign in to comment.