Add rm -r for folders, and make ls list one folder level
rm -r FOLDER deletes a folder and everything under it, records and objects, so the space is freed. It lists what will go (the first 20 names, then a count) with the total size and asks on the terminal; no answer or no terminal deletes nothing. -f skips the question and makes a missing name a no-op, -rf and -fr combine them, and rm -r / is refused. Objects still in use are worked out once per delete, not once per file. ls now shows one level, like ls(1): sub-folders once with a trailing slash, their total size and newest date, then the files, with names relative to the folder. list keeps the recursive listing of full names that scripts pipe through cut -c31-, and ls -r is the same. Docs, man pages, the guide (new rm-r screenshot) and README follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
730877823e
commit
0d45ecea59
+14
-1
@@ -266,8 +266,9 @@ def main():
|
||||
shoot("add", t)
|
||||
|
||||
t = Term(box)
|
||||
t.cmd("vault ls", P)
|
||||
t.cmd("vault ls letters", P)
|
||||
t.cmd("vault list", P)
|
||||
t.cmd("vault list letters", P)
|
||||
shoot("list", t)
|
||||
|
||||
t = Term(box)
|
||||
@@ -315,6 +316,18 @@ def main():
|
||||
t.cmd("ls Scans")
|
||||
shoot("migrate", t)
|
||||
|
||||
# rm -r: lists the folder, asks, then frees the space
|
||||
t = Term(box)
|
||||
t.cmd("vault ls", P)
|
||||
t.lines.append(prompt() + '<span class="c">vault rm -r receipts</span>')
|
||||
for line in box.run_tty("vault rm -r receipts", P, "y").split("\n"):
|
||||
esc = html.escape(line)
|
||||
if "[y/N]" in line:
|
||||
esc = '<span class="hl">%s</span>' % esc
|
||||
t.lines.append(esc)
|
||||
t.cmd("vault ls", P)
|
||||
shoot("rm-r", t)
|
||||
|
||||
# absorb: a tar archive piped in, here pulled from a gzipped tarball
|
||||
box.write("Projects/website/index.html", "<h1>hello</h1>\n")
|
||||
box.write("Projects/website/css/site.css", "body{}\n")
|
||||
|
||||
Reference in New Issue
Block a user