ollie-9p: rename 'remove' command to 'rm'

Standard name. Updated prompt and usage accordingly.
This commit is contained in:
Levi Neely 2026-07-29 20:36:32 +02:00
parent 216a774477
commit 3833ba2860
2 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@
// stat path print file metadata
// ls [-l] [-d] path list directory contents
// create path create a file
// remove path remove a file
// rm path remove a file
// mkdir path create a directory
package main
@ -36,7 +36,7 @@ var (
func usage() {
fmt.Fprintf(os.Stderr, "usage: ollie-9p [-a addr] cmd args...\n")
fmt.Fprintf(os.Stderr, "commands: read write rdwr stat ls create remove mkdir\n")
fmt.Fprintf(os.Stderr, "commands: read write rdwr stat ls create rm mkdir\n")
os.Exit(1)
}
@ -83,9 +83,9 @@ func main() {
fatalf("usage: ollie-9p create path")
}
cmdCreate(args[0])
case "remove":
case "rm":
if len(args) != 1 {
fatalf("usage: ollie-9p remove path")
fatalf("usage: ollie-9p rm path")
}
cmdRemove(args[0])
case "mkdir":
@ -292,7 +292,7 @@ func cmdCreate(path string) {
func cmdRemove(path string) {
fsys := dial()
if err := fsys.Remove(path); err != nil {
fatalf("remove %s: %v", path, err)
fatalf("rm %s: %v", path, err)
}
}

View File

@ -109,7 +109,7 @@ echo "cwd=$PWD" | ollie-9p write session/new
printf 'name=reviewer\ncwd=%s\n' "$PWD" | ollie-9p write session/new
# Kill a session
ollie-9p remove session/{id}
ollie-9p rm session/{id}
# Rename a session
echo "rn newname" | ollie-9p write session/{id}/ctl
@ -151,5 +151,5 @@ ollie-9p create session/{id}/peer/{peerid}
echo "your message" | ollie-9p write session/{id}/peer/{peerid}
# Remove a peer link (bidirectional)
ollie-9p remove session/{id}/peer/{peerid}
ollie-9p rm session/{id}/peer/{peerid}
```