scripts: Simplified dbgtag.py, tweaked -x/--hex decoding
This drops the option to read tags from a disk file. I don't think I've ever used this, and it requires quite a bit of circuitry to implement. Also dropped -s/--string, because most tags can't be represented as strings? And tweaked -x/--hex flags to correctly parse spaces in arguments, so now these are equivalent: - ./scripts/dbgtag.py -x 00 03 00 08 - ./scripts/dbgtag.py -x "00 03 00 08"
This commit is contained in:
+2
-1
@@ -33,7 +33,8 @@ def crc32c(data, crc=0):
|
||||
def main(paths, **args):
|
||||
# interpret as sequence of hex bytes
|
||||
if args.get('hex'):
|
||||
print('%08x' % crc32c(bytes(int(path, 16) for path in paths)))
|
||||
bytes_ = [b for path in paths for b in path.split()]
|
||||
print('%08x' % crc32c(bytes(int(b, 16) for b in bytes_)))
|
||||
|
||||
# interpret as strings
|
||||
elif args.get('string'):
|
||||
|
||||
Reference in New Issue
Block a user