Added the option to error on no valid commit to dbgrbyd.py

Considered adding --ignore-errors to watch.py, but it doesn't really
make sense with watch.py's implementation. watch.py would need to not update
in realtime, which conflicts with other use cases.
This commit is contained in:
Christopher Haster
2022-12-28 02:29:24 -06:00
parent 5cdda57373
commit 8d4991df6a

View File

@@ -326,6 +326,9 @@ def main(disk, block_size, block1, block2=None, *,
else:
alts = []
if args.get('error_on_corrupt') and off == 0:
sys.exit(2)
if __name__ == "__main__":
import argparse
@@ -382,6 +385,10 @@ if __name__ == "__main__":
'-j', '--jumps',
action='store_true',
help="Show alt pointer jumps in the margin.")
parser.add_argument(
'-e', '--error-on-corrupt',
action='store_true',
help="Error if no valid commit is found.")
sys.exit(main(**{k: v
for k, v in vars(parser.parse_intermixed_args()).items()
if v is not None}))