[clang-tools-extra] r326321 - [clang-tidy] Fix 'add_new_check.py --udpate-docs'

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 04:21:38 PST 2018


Author: alexfh
Date: Wed Feb 28 04:21:38 2018
New Revision: 326321

URL: http://llvm.org/viewvc/llvm-project?rev=326321&view=rev
Log:
[clang-tidy] Fix 'add_new_check.py --udpate-docs'

Modified:
    clang-tools-extra/trunk/clang-tidy/add_new_check.py

Modified: clang-tools-extra/trunk/clang-tidy/add_new_check.py
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/add_new_check.py?rev=326321&r1=326320&r2=326321&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/add_new_check.py (original)
+++ clang-tools-extra/trunk/clang-tidy/add_new_check.py Wed Feb 28 04:21:38 2018
@@ -320,9 +320,11 @@ def main():
       metavar='LANG')
   parser.add_argument(
       'module',
+      nargs='?',
       help='module directory under which to place the new tidy check (e.g., misc)')
   parser.add_argument(
       'check',
+      nargs='?',
       help='name of new tidy check to add (e.g. foo-do-the-stuff)')
   args = parser.parse_args()
 
@@ -330,6 +332,11 @@ def main():
     update_checks_list(os.path.dirname(sys.argv[0]))
     return
 
+  if not args.module or not args.check:
+    print 'Module and check must be specified.'
+    parser.print_usage()
+    return
+
   module = args.module
   check_name = args.check
 




More information about the cfe-commits mailing list