CRAS: cras_tests: clean up argument parsing

Move the rest of the argument parsing code and error handling into
the parse_from_args function in the audio_options module.

Change the parameter type of parse_from_args to be easier to test and
add tests.

Change the type of optional arguments to be Option<usize> (so that
we can differentiate between taking a default value when none is given,
vs. an actual parameter).

Add an enum for the valid subcommands (Playback and Capture).

Convert file_name from String to PathBuf.

BUG=chromium:1008990
TEST=cargo test

Change-Id: I7e90d561060ccc3152842d9ad492257e92c19c05
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/1832581
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Fletcher Woodruff <fletcherw@chromium.org>
Commit-Queue: Fletcher Woodruff <fletcherw@chromium.org>
2 files changed