Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/fprime_gds/executables/data_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def main():
subcommands_parser = root_parser.add_subparsers(dest='command')

decode_parser = subcommands_parser.add_parser('decode', help='Decode a data product binary into a human-readable format')
decode_parser.add_argument("-b", "--binFile", required=True, help="Path to input data product binary file (.fdp)")
decode_parser.add_argument("-b", "--bin-file", required=True, help="Path to input data product binary file (.fdp)")
decode_parser.add_argument("-d", "--dictionary", required=True, help="Path to F Prime JSON Dictionary")
decode_parser.add_argument("-o", "--output", required=False, help="Path to output JSON file (defaults to <binFilename>.json)")

validate_parser = subcommands_parser.add_parser('validate', help='Validate a data product')
validate_parser.add_argument("-b", "--binFile", required=True, help="Path to input data product binary file (.fdp)")
validate_parser.add_argument("-b", "--bin-file", required=True, help="Path to input data product binary file (.fdp)")
validate_parser.add_argument("-d", "--dictionary", required=False, help="Path to F Prime JSON Dictionary")
validate_parser.add_argument("-s", "--header-size", type=int, default=0, help="Use the provided value as the header size for the data product")
validate_parser.add_argument("-g", "--guess-size", action="store_true", help="Guess at the header size")
Expand All @@ -29,15 +29,15 @@ def main():

if args.command == "decode":
assert args.dictionaries is not None, "Dictionaries must be loaded"
DataProductDecoder(args.dictionaries, args.binFile, args.output).process()
DataProductDecoder(args.dictionaries, args.bin_file, args.output).process()

elif args.command == "validate":
success = DataProductValidator(
dictionary=args.dictionary,
header_size=args.header_size if args.header_size > 0 else None,
guess_size=args.guess_size,
verbose=args.verbose
).process(args.binFile)
).process(args.bin_file)

return 0 if success else 1

Expand Down
Loading