- global args
-
- parser = argparse.ArgumentParser(description='')
-
- parser.add_argument('--input-file',
- dest='input_file',
- action='store',
- type=str,
- help='Input file')
-
- parser.add_argument('--output-file',
- dest='output_file',
- action='store',
- type=str,
- help='Output file')
-
- parser.add_argument('--version',
- dest='tag_version',
- action='store',
- type=auto_int,
- help='WFI Tag Version')
-
- parser.add_argument('--chip-id',
- dest='chip_id',
- action='store',
- type=auto_int,
- help='WFI Chip ID')
-
- parser.add_argument('--flash-type',
- dest='flash_type',
- action='store',
- type=auto_int,
- help='WFI Flash Type')
-
- parser.add_argument('--flags',
- dest='flags',
- action='store',
- type=auto_int,
- help='WFI Flags')
-
- args = parser.parse_args()
-
- if not args.flags:
- args.flags = 0
-
- if ((not args.input_file) or
- (not args.output_file) or
- (not args.tag_version) or
- (not args.chip_id) or
- (not args.flash_type)):
- parser.print_help()
- else:
- create_output(args)
+ global args
+
+ parser = argparse.ArgumentParser(description="")
+
+ parser.add_argument(
+ "--input-file",
+ dest="input_file",
+ action="store",
+ type=str,
+ help="Input file",
+ )
+
+ parser.add_argument(
+ "--output-file",
+ dest="output_file",
+ action="store",
+ type=str,
+ help="Output file",
+ )
+
+ parser.add_argument(
+ "--version",
+ dest="tag_version",
+ action="store",
+ type=auto_int,
+ help="WFI Tag Version",
+ )
+
+ parser.add_argument(
+ "--chip-id",
+ dest="chip_id",
+ action="store",
+ type=auto_int,
+ help="WFI Chip ID",
+ )
+
+ parser.add_argument(
+ "--flash-type",
+ dest="flash_type",
+ action="store",
+ type=auto_int,
+ help="WFI Flash Type",
+ )
+
+ parser.add_argument(
+ "--flags", dest="flags", action="store", type=auto_int, help="WFI Flags"
+ )
+
+ args = parser.parse_args()
+
+ if not args.flags:
+ args.flags = 0
+
+ if (
+ (not args.input_file)
+ or (not args.output_file)
+ or (not args.tag_version)
+ or (not args.chip_id)
+ or (not args.flash_type)
+ ):
+ parser.print_help()
+ else:
+ create_output(args)
+