Use ArgumentParser::parseArgsOrExit()
This commit is contained in:
parent
778b31c0ed
commit
7065b62aee
|
@ -34,7 +34,7 @@ set(META_VERSION_MINOR 2)
|
||||||
set(META_VERSION_PATCH 2)
|
set(META_VERSION_PATCH 2)
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.0.0 REQUIRED)
|
find_package(c++utilities 4.10.0 REQUIRED)
|
||||||
use_cpp_utilities()
|
use_cpp_utilities()
|
||||||
|
|
||||||
# find qtutilities
|
# find qtutilities
|
||||||
|
|
7
main.cpp
7
main.cpp
|
@ -55,12 +55,7 @@ int main(int argc, char *argv[])
|
||||||
{ &applicationArg, &sinkArg, &ffmpegInputOptions, &targetDirArg, &targetExtArg, &ignorePlaybackStatusArg, &ffmpegBinArg, &ffmpegOptions });
|
{ &applicationArg, &sinkArg, &ffmpegInputOptions, &targetDirArg, &targetExtArg, &ignorePlaybackStatusArg, &ffmpegBinArg, &ffmpegOptions });
|
||||||
parser.setMainArguments({ &helpArg, &recordArg });
|
parser.setMainArguments({ &helpArg, &recordArg });
|
||||||
// parse command line arguments
|
// parse command line arguments
|
||||||
try {
|
parser.parseArgsOrExit(argc, argv);
|
||||||
parser.parseArgs(argc, argv);
|
|
||||||
} catch (const Failure &e) {
|
|
||||||
cerr << "Unable to parse arguments: " << e.what() << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
if (recordArg.isPresent()) {
|
if (recordArg.isPresent()) {
|
||||||
// start watching/recording
|
// start watching/recording
|
||||||
|
|
Loading…
Reference in New Issue