+ parser = argparse.ArgumentParser(description="Decode a kcdata binary file.")
+ parser.add_argument("-l", "--listtypes", action="store_true", required=False, default=False,
+ help="List all known types",
+ dest="list_known_types")
+
+ parser.add_argument("-s", "--stackshot", required=False, default=False,
+ help="Generate a stackshot report file",
+ dest="stackshot_file")
+
+ parser.add_argument("--multiple", help="look for multiple stackshots in a single file", action='store_true')
+
+ parser.add_argument("-p", "--plist", required=False, default=False,
+ help="output as plist", action="store_true")
+
+ parser.add_argument("-S", "--sdk", required=False, default="", help="sdk property passed to xcrun command to find the required tools. Default is empty string.", dest="sdk")
+ parser.add_argument("--pretty", default=False, action='store_true', help="make the output a little more human readable")
+ parser.add_argument("--incomplete", action='store_true', help="accept incomplete data")
+ parser.add_argument("kcdata_file", type=argparse.FileType('r'), help="Path to a kcdata binary file.")
+
+ class VerboseAction(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ logging.basicConfig(level=logging.INFO, stream=sys.stderr, format='%(message)s')
+ parser.add_argument('-v', "--verbose", action=VerboseAction, nargs=0)
+