Add list tools; normalize tool names and paths in transcript
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"g.fc.run/ai/byre/internal/dirlist"
|
||||
)
|
||||
|
||||
func listCmd(args []string) {
|
||||
if len(args) != 1 {
|
||||
usage()
|
||||
}
|
||||
out, err := dirlist.List(args[0])
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Print(out)
|
||||
}
|
||||
+3
-1
@@ -24,13 +24,15 @@ func main() {
|
||||
signingCmd(os.Args[2:])
|
||||
case "grep":
|
||||
grepCmd(os.Args[2:])
|
||||
case "list":
|
||||
listCmd(os.Args[2:])
|
||||
default:
|
||||
usage()
|
||||
}
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintln(os.Stderr, "usage: byre serve | byre install | byre check | byre run [--resume ID] | byre signing CHECKOUT | byre grep [--glob GLOB] [--ignore-case] [--files-only] PATTERN PATH")
|
||||
fmt.Fprintln(os.Stderr, "usage: byre serve | byre install | byre check | byre run [--resume ID] | byre signing CHECKOUT | byre grep [--glob GLOB] [--ignore-case] [--files-only] PATTERN PATH | byre list PATH")
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user