util/OptionParser: use std::span instead of ConstBuffer
This commit is contained in:
@@ -79,7 +79,7 @@ ParseCommandLine(int argc, char **argv)
|
||||
}
|
||||
|
||||
auto args = option_parser.GetRemaining();
|
||||
if (args.size != 2)
|
||||
if (args.size() != 2)
|
||||
throw std::runtime_error("Usage: RunChromaprint [--verbose] [--config=FILE] DECODER URI");
|
||||
|
||||
c.decoder = args[0];
|
||||
|
@@ -82,7 +82,7 @@ ParseCommandLine(int argc, char **argv)
|
||||
}
|
||||
|
||||
auto args = option_parser.GetRemaining();
|
||||
if (args.size != 2)
|
||||
if (args.size() != 2)
|
||||
throw std::runtime_error("Usage: run_convert IN_FORMAT OUT_FORMAT <IN >OUT");
|
||||
|
||||
c.in_audio_format = ParseAudioFormat(args[0], false);
|
||||
|
@@ -87,7 +87,7 @@ ParseCommandLine(int argc, char **argv)
|
||||
}
|
||||
|
||||
auto args = option_parser.GetRemaining();
|
||||
if (args.size != 2)
|
||||
if (args.size() != 2)
|
||||
throw std::runtime_error("Usage: run_decoder [--verbose] [--config=FILE] DECODER URI");
|
||||
|
||||
c.decoder = args[0];
|
||||
|
@@ -124,7 +124,7 @@ ParseCommandLine(int argc, char **argv)
|
||||
}
|
||||
|
||||
auto args = option_parser.GetRemaining();
|
||||
if (args.size != 1)
|
||||
if (args.size() != 1)
|
||||
throw std::runtime_error("Usage: run_input [--verbose] [--config=FILE] [--scan] [--chunk-size=BYTES] URI");
|
||||
|
||||
c.uri = args.front();
|
||||
|
@@ -76,13 +76,13 @@ ParseCommandLine(int argc, char **argv)
|
||||
}
|
||||
|
||||
auto args = option_parser.GetRemaining();
|
||||
if (args.size < 2 || args.size > 3)
|
||||
if (args.size() < 2 || args.size() > 3)
|
||||
throw std::runtime_error("Usage: run_output CONFIG NAME [FORMAT] <IN");
|
||||
|
||||
c.config_path = args[0];
|
||||
c.output_name = args[1];
|
||||
|
||||
if (args.size > 2)
|
||||
if (args.size() > 2)
|
||||
c.audio_format = ParseAudioFormat(args[2], false);
|
||||
|
||||
return c;
|
||||
|
Reference in New Issue
Block a user