[clang-tidy] Fix 'add_new_check.py --udpate-docs'
authorAlexander Kornienko <alexfh@google.com>
Wed, 28 Feb 2018 12:21:38 +0000 (12:21 +0000)
committerAlexander Kornienko <alexfh@google.com>
Wed, 28 Feb 2018 12:21:38 +0000 (12:21 +0000)
llvm-svn: 326321

clang-tools-extra/clang-tidy/add_new_check.py

index f38e59b..ab0c883 100755 (executable)
@@ -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