ebak32

argparse exception

May 4th, 2016
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. # --checkers checkers (--url URL --project Prj [--dump]) | (--mergeInput input.txt [--removeDisabled])
  2. if __name__ == "__main__":
  3.     import argparse
  4.     parser = argparse.ArgumentParser(
  5.         description="Sets the checkers of a klocwork project")
  6.     mutexGroup = parser.add_mutually_exclusive_group(required=True)
  7.     serverGroup = mutexGroup.add_argument_group('serverGroup')
  8.     serverGroup.add_argument("-u", "--url", action="store", required=True, help="klocwork server URL.")
  9.     serverGroup.add_argument("-p", "--project", action="store", required=True, help="klocwork project name.")
  10.     serverGroup.add_argument("--dump", action="store_true", required=False, help="Dump the current checkers config.")
  11.     mergeGroup = mutexGroup.add_argument_group('mergeGroup')
  12.     mergeGroup.add_argument(
  13.         "--mergeInput", action="store", required=True,
  14.         help="Input file to merge for the '--checkers' file. Format: checkerName Enabled|Disabled")
  15.     mergeGroup.add_argument(
  16.         "--removeDisabled", action="store_true", required=False,
  17.         help="Disabled checkers will be removed from the '--checkers' file.")
  18.     parser.add_argument(
  19.         "-c", "--checkers", action="store", required=True, help="File which lists the checkers to be enabled.")
  20.  
  21.     args = parser.parse_args()
Add Comment
Please, Sign In to add comment