Mention 'tahoe run' in running.html, and improve tahoe --help text #856
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#856
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From #355:
These seem like good doc improvements to me. They're independent of the other problems with
tahoe run
in #355.FYI, I don't think there's a way to override the alphabetical sorting of subcommands in
twisted.python.usage.Option
's base-class code which generates the output that "bin/tahoe" (without a subcommand) provokes. But if you override the "getUsage" method onallmydata.scripts.runner.Options
(usingallmydata.scripts.cli.GetOptions.getUsage
as a template), you can probably replace the command listing with different text. This might be a good place to emit something else, like:Oh, one correction, usage.Option doesn't just sort its subcommands alphabetically: it retains the order in which they were provided (notice that
bin/tahoe
's output puts all the create-node commands at the start, and all the start/stop commands at the end.. this matches the way that_general_commands
andsubCommands
are built in src/allmydata/scripts/runner.py).That probably doesn't help insert extra text into the usage output, though.. you'll probably still have to override getUsage. But consider upcalling and then inserting text into the result (instead of writing something entirely new), because doing it that way will be more robust against the addition of new subcommands in the future.
Attachment running.html_diff.txt (2280 bytes) added
Diff for source:docs/running.html to describe tahoe run
New help text:
Rearranging the command groups and adding some text about
tahoe <command> --help
at the bottom:wow, that's awesome, in a kinda scary way :). I'd sort of suggest using a try:finally: clause to make sure that
self.subCommands
gets set back to its original value even if an exception is raised in the middle, but that code is only going to get invoked after subCommands is used and just before the whole process exits, so it probably isn't too important.Please double-check that the trick you're using will work against our oldest supported version of Twisted (which is.. aagh! zooko! well, it used to be in README, and then in INSTALL, and now I can't find it in the docs/ directory. So first harass Zooko to ressurect our human-readable dependency list, then check it for the oldest version of Twisted that we claim compatibility with, and then check that version of Twisted :). I believe usage.Options has remained unchanged for years, so I expect your trick to work everywhere, but it'd be good to make sure.
Our "human-readable" dependency list is in source:_auto_deps.py, and it says
"Twisted >= 2.4.0"
. If David-Sarah's hack doesn't work with Twisted 2.4.0 we should consider raising the minimum version requirement. Currently on our Supported builders the oldest version of Twisted in use is Twisted 8.1.0 (in Debian 5.0 Lenny and in NetBSD 4). If David-Sarah's hack works for all versions of Twisted > X for some X <= 8.1.0 then I would support it.ok, I think we need a pointer to it from some other human-readable document, like the way that most projects have a README or an INSTALL which tells you what the dependencies are (
grep auto_deps README docs/*
shows nothing). I know that you've tried hard to not frighten people with such details, but I think they need to be findable by the people who want them.But anyways, I don't see any changes to twisted.python.usage between 2.4.0 and current trunk (which is 9.0.0+), so I think David-Sarah's hack should work equally well across that range.
Looking at the source for Twisted's
usage.py
, this hack should work going back to revision 7653 in July 2003, which introduced thegetUsage
method. We depend ongetUsage
elsewhere, e.g. incli.py
. That would have been way before Twisted 2.4.0, which was released in 2006.I agree about the
try: finally:
.Attachment runner.py_diff.txt (2010 bytes) added
Diff for source:src/allmydata/scripts/runner.py to split usage into groups (better approach)
Replying to warner:
I changed it to use another class so that
self.subCommands
doesn't need to be modified in theOptions
instance.Attachment tahoe-help-group-commands.darcspatch.txt (36634 bytes) added
Split tahoe --help options into groups
Attachment change-running-html-to-describe-tahoe-run.darcspatch.txt (36458 bytes) added
Change running.html to describe 'tahoe run'
The command grouping is a very simple patch, and I think it does help make the
tahoe --help text
more readable. Anyone want to review it for 1.6?Thank you! I really like the command grouping! Applied as changeset:b94b9af1896ec527, changeset:b079f32da2aa0746, changeset:a1444d9367554df7, and changeset:5c04fd689ab4b3bf.