From efdcb912f5d1eef4a6d3c851c14ea645c1b3228f Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 16 Nov 2025 15:00:33 -0600 Subject: [PATCH] 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. --- scripts/codemap.py | 2 +- scripts/codemapsvg.py | 2 +- scripts/dbg.gdb.py | 2 +- scripts/dbgbmap.py | 2 +- scripts/dbgbmapsvg.py | 2 +- scripts/dbgbtree.py | 19 +++++++++++-------- scripts/dbgle32.py | 3 ++- scripts/dbgleb128.py | 3 ++- scripts/dbglfs3.py | 31 +++++++++++++++++-------------- scripts/dbgmtree.py | 23 +++++++++++++---------- scripts/dbgrbyd.py | 19 +++++++++++-------- scripts/dbgtag.py | 3 ++- scripts/dbgtrace.py | 2 +- scripts/treemap.py | 2 +- scripts/treemapsvg.py | 2 +- 15 files changed, 66 insertions(+), 51 deletions(-) diff --git a/scripts/codemap.py b/scripts/codemap.py index 19cd026c..2dc9f546 100755 --- a/scripts/codemap.py +++ b/scripts/codemap.py @@ -1731,7 +1731,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --to-scale=1 and --no-header.") parser.add_argument( diff --git a/scripts/codemapsvg.py b/scripts/codemapsvg.py index 4500d762..6e451640 100755 --- a/scripts/codemapsvg.py +++ b/scripts/codemapsvg.py @@ -2400,7 +2400,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --to-scale=1, --no-header, " "--no-label, --no-stack, and --no-javascript.") diff --git a/scripts/dbg.gdb.py b/scripts/dbg.gdb.py index eaf510a3..d053951c 100644 --- a/scripts/dbg.gdb.py +++ b/scripts/dbg.gdb.py @@ -40,7 +40,7 @@ def gdbsplit(v): # # Note some tricks to help interact with bash and gdb: # -# - Flags are passed as is (-b4096, -t, --trunk) +# - Flags are passed as is (-h, -b4096, --trunk) # - All non-flags are parsed as expressions (file->b.shrub.blocks[0]) # - String expressions may be useful for paths and stuff ("./disk") # diff --git a/scripts/dbgbmap.py b/scripts/dbgbmap.py index 819d5bed..77414b41 100755 --- a/scripts/dbgbmap.py +++ b/scripts/dbgbmap.py @@ -5354,7 +5354,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --block-ratio=1, --to-scale=1, " "and --no-header.") diff --git a/scripts/dbgbmapsvg.py b/scripts/dbgbmapsvg.py index 93ffda97..647bef85 100755 --- a/scripts/dbgbmapsvg.py +++ b/scripts/dbgbmapsvg.py @@ -5633,7 +5633,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --block-ratio=1, --to-scale=1, " "--padding=0, --no-header, --no-label, and --no-javascript.") diff --git a/scripts/dbgbtree.py b/scripts/dbgbtree.py index 313b003a..3f8829a6 100755 --- a/scripts/dbgbtree.py +++ b/scripts/dbgbtree.py @@ -1432,7 +1432,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: @@ -1785,8 +1785,8 @@ def main(disk, roots=None, *, # precompute tree renderings t_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(btree, **args) t_width = treeart.width @@ -1807,8 +1807,8 @@ def main(disk, roots=None, *, if prbyd is None or rbyd != prbyd else '', 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*w_width+1, '%d-%d' % (bid-(rattr.weight-1), bid) @@ -1918,15 +1918,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( diff --git a/scripts/dbgle32.py b/scripts/dbgle32.py index 920c4139..aff8d00f 100755 --- a/scripts/dbgle32.py +++ b/scripts/dbgle32.py @@ -99,7 +99,8 @@ if __name__ == "__main__": '-i', '--input', help="Read le32s from this file. Can use - for stdin.") parser.add_argument( - '-w', '--word-bits', + '-w', '--word', '--word-bits', + dest='word_bits', nargs='?', type=lambda x: int(x, 0), const=0, diff --git a/scripts/dbgleb128.py b/scripts/dbgleb128.py index df8d7aaa..af98a181 100755 --- a/scripts/dbgleb128.py +++ b/scripts/dbgleb128.py @@ -111,7 +111,8 @@ if __name__ == "__main__": '-i', '--input', help="Read leb128s from this file. Can use - for stdin.") parser.add_argument( - '-w', '--word-bits', + '-w', '--word', '--word-bits', + dest='word_bits', nargs='?', type=lambda x: int(x, 0), const=0, diff --git a/scripts/dbglfs3.py b/scripts/dbglfs3.py index 4eaf679b..4b09299f 100755 --- a/scripts/dbglfs3.py +++ b/scripts/dbglfs3.py @@ -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( diff --git a/scripts/dbgmtree.py b/scripts/dbgmtree.py index 8718e02d..6d3c10aa 100755 --- a/scripts/dbgmtree.py +++ b/scripts/dbgmtree.py @@ -2350,7 +2350,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: @@ -2899,8 +2899,8 @@ def main(disk, mroots=None, *, # precompute tree renderings t_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.frommtree(mtree, **args) t_width = treeart.width @@ -2929,8 +2929,8 @@ def main(disk, mroots=None, *, if not isinstance(pmdir, Mdir) or mdir != pmdir else '', treeart.repr((mid, 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 '', '%*s %-*s%s' % ( @@ -2980,8 +2980,8 @@ def main(disk, mroots=None, *, (mtree.mid(bid-(name.weight-1), -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*w_width+1, '%d-%d' % ( @@ -3138,15 +3138,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( diff --git a/scripts/dbgrbyd.py b/scripts/dbgrbyd.py index c29502e6..88eccba2 100755 --- a/scripts/dbgrbyd.py +++ b/scripts/dbgrbyd.py @@ -1382,7 +1382,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: @@ -1700,8 +1700,8 @@ def dbg_tree(rbyd, *, # precompute tree renderings t_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')): tree = TreeArt.fromrbyd(rbyd, **args) t_width = tree.width @@ -1714,8 +1714,8 @@ def dbg_tree(rbyd, *, print('%08x: %s%*s %-*s %s' % ( rattr.toff, tree.repr((rid, 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*w_width+1, '%d-%d' % (rid-(rattr.weight-1), rid) @@ -1867,15 +1867,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( diff --git a/scripts/dbgtag.py b/scripts/dbgtag.py index 343ed04e..4220b94d 100755 --- a/scripts/dbgtag.py +++ b/scripts/dbgtag.py @@ -383,7 +383,8 @@ if __name__ == "__main__": '-i', '--input', help="Read tags from this file. Can use - for stdin.") parser.add_argument( - '-w', '--word-bits', + '-w', '--word', '--word-bits', + dest='word_bits', nargs='?', type=lambda x: int(x, 0), const=0, diff --git a/scripts/dbgtrace.py b/scripts/dbgtrace.py index b9ca15e3..d8f1698d 100755 --- a/scripts/dbgtrace.py +++ b/scripts/dbgtrace.py @@ -1890,7 +1890,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --block-ratio=1, --to-scale=1, " "and --no-header.") diff --git a/scripts/treemap.py b/scripts/treemap.py index 527edc33..20e63162 100755 --- a/scripts/treemap.py +++ b/scripts/treemap.py @@ -1557,7 +1557,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --to-scale=1 and --no-header.") parser.add_argument( diff --git a/scripts/treemapsvg.py b/scripts/treemapsvg.py index 09135d43..296c4790 100755 --- a/scripts/treemapsvg.py +++ b/scripts/treemapsvg.py @@ -1220,7 +1220,7 @@ if __name__ == "__main__": if ':' in x else float(x)), help="Aspect ratio to use with --to-scale. Defaults to 1:1.") parser.add_argument( - '-t', '--tiny', + '--tiny', action='store_true', help="Tiny mode, alias for --to-scale=1, --no-header, and " "--no-label.")