mirror of
https://github.com/rwxrob/bonzai
synced 2024-11-12 07:10:26 +00:00
Drop bonzai command from module
This commit is contained in:
parent
a9acfa8a91
commit
1fe3463513
@ -1,43 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/rwxrob/bonzai/help"
|
||||
Z "github.com/rwxrob/bonzai/z"
|
||||
"github.com/rwxrob/term"
|
||||
)
|
||||
|
||||
func main() {
|
||||
Cmd.Run()
|
||||
}
|
||||
|
||||
var Cmd = &Z.Cmd{
|
||||
Name: `bonzai`,
|
||||
Summary: `bonzai command tree utility`,
|
||||
Version: `v0.0.1`,
|
||||
Copyright: `Copyright 2021 Robert S Muhlestein`,
|
||||
License: `Apache-2.0`,
|
||||
Commands: []*Z.Cmd{help.Cmd, sh2slice},
|
||||
}
|
||||
|
||||
var sh2slice = &Z.Cmd{
|
||||
Name: `sh2slice`,
|
||||
Summary: `splits a shell command into arguments`,
|
||||
Commands: []*Z.Cmd{help.Cmd},
|
||||
Call: func(_ *Z.Cmd, args ...string) error {
|
||||
list := []string{}
|
||||
if len(args) == 0 {
|
||||
args = append(args, term.Read())
|
||||
}
|
||||
for _, a := range args {
|
||||
// FIXME add awareness or globs and quoted segments
|
||||
for _, aa := range strings.Fields(a) {
|
||||
list = append(list, fmt.Sprintf("%q", aa))
|
||||
}
|
||||
}
|
||||
fmt.Println(strings.Join(list, ","))
|
||||
return nil
|
||||
},
|
||||
}
|
12
go.work.off
12
go.work.off
@ -1,12 +0,0 @@
|
||||
go 1.19
|
||||
|
||||
use (
|
||||
.
|
||||
../fs
|
||||
../twitch
|
||||
../fn
|
||||
../scan
|
||||
../to
|
||||
../uniq
|
||||
../term
|
||||
)
|
Loading…
Reference in New Issue
Block a user