summaryrefslogtreecommitdiff
path: root/src/cam/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/main.cpp')
-rw-r--r--src/cam/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index 1ca7862b..e7490c32 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -67,9 +67,12 @@ static int parseOptions(int argc, char *argv[])
parser.addOption(OptList, OptionNone, "List all cameras", "list");
options = parser.parse(argc, argv);
- if (!options.valid() || options.isSet(OptHelp)) {
+ if (!options.valid())
+ return -EINVAL;
+
+ if (options.empty() || options.isSet(OptHelp)) {
parser.usage();
- return !options.valid() ? -EINVAL : -EINTR;
+ return options.empty() ? -EINVAL : -EINTR;
}
return 0;