[PATCH] D52746: [clang-query] Add single-letter 'q' alias for 'quit'
Stephen Kelly via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 2 11:08:43 PDT 2018
steveire updated this revision to Diff 167984.
steveire added a comment.
Add docs
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D52746
Files:
clang-query/Query.cpp
clang-query/QueryParser.cpp
unittests/clang-query/QueryParserTest.cpp
Index: unittests/clang-query/QueryParserTest.cpp
===================================================================
--- unittests/clang-query/QueryParserTest.cpp
+++ unittests/clang-query/QueryParserTest.cpp
@@ -51,6 +51,9 @@
QueryRef Q = parse("quit");
ASSERT_TRUE(isa<QuitQuery>(Q));
+ Q = parse("q");
+ ASSERT_TRUE(isa<QuitQuery>(Q));
+
Q = parse("quit me");
ASSERT_TRUE(isa<InvalidQuery>(Q));
EXPECT_EQ("unexpected extra input: ' me'", cast<InvalidQuery>(Q)->ErrStr);
Index: clang-query/QueryParser.cpp
===================================================================
--- clang-query/QueryParser.cpp
+++ clang-query/QueryParser.cpp
@@ -166,6 +166,7 @@
.Case("let", PQK_Let)
.Case("m", PQK_Match, /*IsCompletion=*/false)
.Case("match", PQK_Match)
+ .Case("q", PQK_Quit, /*IsCompletion=*/false)
.Case("quit", PQK_Quit)
.Case("set", PQK_Set)
.Case("unlet", PQK_Unlet)
Index: clang-query/Query.cpp
===================================================================
--- clang-query/Query.cpp
+++ clang-query/Query.cpp
@@ -45,7 +45,7 @@
"Set whether to print bindings as diagnostics,\n"
" "
"AST pretty prints or AST dumps.\n"
- " quit "
+ " quit, q "
"Terminates the query session.\n\n";
return true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52746.167984.patch
Type: text/x-patch
Size: 1588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181002/8deb78d5/attachment.bin>
More information about the cfe-commits
mailing list