scripts: Renamed -w/--wait -> -t/--wait

I'm trying to avoid the inevitable conflict with -w/--word, which will
probably become important when exploring non-32-bit filesystem
configurations.

Renaming this to -t/--wait still conflicts with -t/--tree and -t/--tiny,
but as a debug-only flag, I think these are less important.

Oh, and -t/--trace, but test.py/bench.py are already quite different in
their flag naming  (see -d/--disk vs -d/--diff).

---

Renamed a few other flags while tweaking things:

- -t/--tiny -> --tiny (dropped shortform)
- -w/--word-bits -> -w/--word/--word-bits
- -t/--tree -> -R/--tree/--rbyd/--tree-rbyd
- -R/--tree-rbyd -> -Y/--rbyd-all/--tree-rbyd-all
- -B/--tree-btree -> -B/--btree/--tree-btree

After tinkering with it a bit, I think the -R/-Y/-B set of flags are a
decent way to organize the tree renderers. At least --tree-rbyd-all does
a better job of describing the difference between --tree-rbyd and
--tree-rbyd-all.
This commit is contained in:
Christopher Haster
2025-11-16 15:00:33 -06:00
parent 9bc41099f0
commit efdcb912f5
15 changed files with 66 additions and 51 deletions
+17 -14
View File
@@ -3876,7 +3876,7 @@ class TreeArt:
else:
alts[ralt.toff] |= {'nf': ralt.off, 'c': ralt.color}
if args.get('tree_rbyd'):
if args.get('tree_rbyd_all'):
# treat unreachable alts as converging paths
for j_, alt in alts.items():
if 'f' not in alt:
@@ -4255,8 +4255,8 @@ def dbg_gstate(lfs, *,
# precompute tree renderings
bt_width = 0
if (args.get('tree')
or args.get('tree_rbyd')
if (args.get('tree_rbyd')
or args.get('tree_rbyd_all')
or args.get('tree_btree')):
treeart = TreeArt.frombtree(gstate.btree, **args)
bt_width = treeart.width
@@ -4280,8 +4280,8 @@ def dbg_gstate(lfs, *,
treeart.repr(
(bid-(name.weight-1), d, rattr.tag),
color)
if args.get('tree')
or args.get('tree_rbyd')
if args.get('tree_rbyd')
or args.get('tree_rbyd_all')
or args.get('tree_btree')
else '',
2*bw_width+1, '%d-%d' % (bid-(rattr.weight-1), bid)
@@ -4573,8 +4573,8 @@ def dbg_files(lfs, paths, *,
# precompute tree renderings
bt_width = 0
if (args.get('tree')
or args.get('tree_rbyd')
if (args.get('tree_rbyd')
or args.get('tree_rbyd_all')
or args.get('tree_btree')):
treeart = TreeArt.fromfile(file, **args)
bt_width = treeart.width
@@ -4596,8 +4596,8 @@ def dbg_files(lfs, paths, *,
treeart.repr(
(bid-(name.weight-1), d, rattr.tag),
color)
if args.get('tree')
or args.get('tree_rbyd')
if args.get('tree_rbyd')
or args.get('tree_rbyd_all')
or args.get('tree_btree')
else '',
2*bw_width+1, '%d-%d' % (bid-(rattr.weight-1), bid)
@@ -4647,8 +4647,8 @@ def dbg_files(lfs, paths, *,
'\x1b[0m' if color and notes else '',
2*w_width+1, '',
treeart.repr((pos, d, bptr.tag), color)
if args.get('tree')
or args.get('tree_rbyd')
if args.get('tree_rbyd')
or args.get('tree_rbyd_all')
or args.get('tree_btree')
else '',
'\x1b[31m' if color and notes else '',
@@ -5050,15 +5050,18 @@ if __name__ == "__main__":
action='store_true',
help="Don't truncate, show the full contents.")
parser.add_argument(
'-t', '--tree',
'-R', '--tree', '--rbyd', '--tree-rbyd',
dest='tree_rbyd',
action='store_true',
help="Show the rbyd tree.")
parser.add_argument(
'-R', '--tree-rbyd',
'-Y', '--rbyd-all', '--tree-rbyd-all',
dest='tree_rbyd_all',
action='store_true',
help="Show the full rbyd tree.")
parser.add_argument(
'-B', '--tree-btree',
'-B', '--btree', '--tree-btree',
dest='tree_btree',
action='store_true',
help="Show a simplified btree tree.")
parser.add_argument(