[Lldb-commits] [PATCH] D84955: Report an error if a CLI option lacks an argument
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 30 11:41:30 PDT 2020
JDevlieghere requested changes to this revision.
JDevlieghere added a comment.
This revision now requires changes to proceed.
Thanks for fixing this. I do have a few comments but the logic looks good.
================
Comment at: lldb/test/Shell/Driver/TestError.test:1
+RUN: not %lldb --arch 2>&1 | FileCheck %s --check-prefix ARGMISSING
+ARGMISSING: error: argument to '--arch' is missing
----------------
Since there's only one prefix to check you can omit `--check-prefix ARGMISSING` and just use CHECK as the prefix on the next line.
================
Comment at: lldb/tools/driver/Driver.cpp:873
+ << "' is missing\n";
+ llvm::errs() << "Use '" << argv0
+ << " --help' for a complete list of options.\n";
----------------
Let's move this and the next line out of check here and below the check for unknown options, so that the user gets to see both errors at once. That way we also don't have to duplicate the error message.
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84955/new/
https://reviews.llvm.org/D84955
More information about the lldb-commits
mailing list