General option handling rule - nu774/qaac GitHub Wiki

qaac.exe uses (Unicode version of) BSD getopt as a command-line parser. Therefore, qaac's command-line handling is the same with ordinary CLI apps/commands. If you are an experienced Unix user, you should be already familiar with it.

qaac takes one or more options, and one more more argument -- which specifies input files for encoding. Options can be omitted, but the input file argument is always necessary, except for --check or --format (these two option are meant for showing some information about qaac, and don't require input file).

Order of (independent) options and filename arguments is not important. The following two lines tell the same thing.

qaac -A input.wav -o output.m4a
qaac -o output.m4a input.wav -A

In the following, I will explain how it works. If you are familiar with Unix commands, you can skip reading.

There exist two kind of options.
Options like -A are short options, prefixed with "-" and distinguished with one character name(in this case, "A").
Options like "--adts" are long options, prefixed with "--" and have long name("adts"). You must be careful which option is used. You can't say -adts instead of --adts.

Option may require an "argument" for it, or not. For example, -A (for ALAC encoding) doesn't require argument, and -o does. -o option needs an output file name, therefore you must feed a file name as an "argument" for -o option.

When argument is required, you just say like -o foo.m4a. Here, option is "-o", and argument is "foo.m4a". They are delimited by a white space here, but this is unnecessary for short options. You can say -ofoo.m4a instead.

For long options, you can say --tvbr 127 or --tvbr=127. Here, option and argument is delimited by either white spaces, or "=". A delimiter is always necessary for long options.

Short options like -A can be merged into one token. You can say -Aofoo.mp4 instead of -A -o foo.mp4.

⚠️ **GitHub.com Fallback** ⚠️