clean tests run: pi 1.5.0 model-list shim, panes checked by process, board r refreshes detail, office . accepted

This commit is contained in:
Sam
2026-11-12 15:49:56 +11:00
parent b81cb91831
commit aa6eb7429d
18 changed files with 1060 additions and 8 deletions

View File

@@ -42,8 +42,8 @@ def parse(argv):
of --remote as the folder, which is exactly the kind of bug that only shows
up when someone uses the flag.
"""
opts = {"folder": ".", "project": "", "session": "", "dry": False,
"host": "", "no_switch": False, "new": "", "remote": ""}
opts = {"folder": ".", "folder_given": False, "project": "", "session": "",
"dry": False, "host": "", "no_switch": False, "new": "", "remote": ""}
positional = []
i = 0
while i < len(argv):
@@ -64,6 +64,7 @@ def parse(argv):
i += 1
if positional:
opts["folder"] = positional[0]
opts["folder_given"] = True
return opts
@@ -254,7 +255,9 @@ def main():
h.say(USAGE.strip())
return 0
opts = parse(argv)
if opts["folder"] in ("", "."):
if not opts["folder_given"]:
# "." is a real folder: `office . --project <name>` adopts the folder you
# are standing in. Only a missing argument is an error.
raise h.Refused(2, "give the folder: office <folder> --project \"<Name>\" (office --help)")
folder = os.path.abspath(os.path.expanduser(opts["folder"]))
if not os.path.isdir(folder):
@@ -289,7 +292,10 @@ def main():
return run_on_remote(opts["remote"], folder, opts)
if opts["dry"]:
h.say("would create a Paperclip project %r for %s" % (opts["new"] or opts["project"], folder))
if opts["new"]:
h.say("would create a Paperclip project %r for %s" % (opts["new"], folder))
else:
h.say("would adopt the Paperclip project %r for %s" % (opts["project"] or "<from .harness/harness.toml>", folder))
h.say("would write %s" % os.path.join(folder, ".harness", "harness.toml"))
h.say("would create or reuse session %r and build eight panes there" % session)
h.say("dry run: nothing was written")