[PATCH] D52746: [clang-query] Add single-letter 'q' alias for 'quit'
Stephen Kelly via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 3 00:54:31 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE343664: [clang-query] Add single-letter 'q' alias for 'quit' (authored by steveire, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52746?vs=167984&id=168077#toc
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/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;
}
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52746.168077.patch
Type: text/x-patch
Size: 1588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181003/c46da910/attachment.bin>
More information about the cfe-commits
mailing list