bb/src/cmd/goblin/main.go

80 lines
3.4 KiB
Go
Raw Normal View History

2022-08-06 05:45:08 +03:00
package main
2023-03-08 16:39:50 +03:00
import (
"github.com/surdeus/goblin/src/tool/awk"
"github.com/surdeus/goblin/src/tool/basename"
2022-08-06 05:45:08 +03:00
"github.com/surdeus/goblin/src/tool/cat"
"github.com/surdeus/goblin/src/tool/date"
"github.com/surdeus/goblin/src/tool/ec"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/echo"
2022-08-06 05:45:08 +03:00
"github.com/surdeus/goblin/src/tool/ftest"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/gfalse"
2022-08-06 05:45:08 +03:00
"github.com/surdeus/goblin/src/tool/grange"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/gtrue"
2022-11-14 17:15:02 +03:00
"github.com/surdeus/goblin/src/tool/in"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/ln"
"github.com/surdeus/goblin/src/tool/ls"
"github.com/surdeus/goblin/src/tool/mergelbl"
2023-01-27 20:05:46 +03:00
"github.com/surdeus/goblin/src/tool/mk"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/mkdir"
"github.com/surdeus/goblin/src/tool/noext"
"github.com/surdeus/goblin/src/tool/path"
"github.com/surdeus/goblin/src/tool/paths"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/quote"
"github.com/surdeus/goblin/src/tool/read"
"github.com/surdeus/goblin/src/tool/sort"
"github.com/surdeus/goblin/src/tool/tac"
"github.com/surdeus/goblin/src/tool/uniq"
"github.com/surdeus/goblin/src/tool/urlprs"
"github.com/surdeus/goblin/src/tool/useprog"
"github.com/surdeus/goblin/src/tool/wc"
2023-02-26 13:12:40 +03:00
"github.com/surdeus/goblin/src/tool/whoami"
2023-03-08 16:39:50 +03:00
"github.com/surdeus/goblin/src/tool/yes"
mtool "github.com/surdeus/gomtool/src/multitool"
2022-08-06 05:45:08 +03:00
)
func main() {
2023-03-08 16:39:50 +03:00
tools := mtool.Tools{
"basename": mtool.Tool{basename.Run, "get base name of file path"},
"cat": mtool.Tool{cat.Run, "print file data to the standard output"},
"mkdir": mtool.Tool{mkdir.Run, "make new directory"},
"echo": mtool.Tool{echo.Run, "print strings to the standard output"},
"true": mtool.Tool{gtrue.Run, "exit with true status"},
"false": mtool.Tool{gfalse.Run, "exit with false status"},
"sort": mtool.Tool{sort.Run, "sort strings inputed from standard input"},
"tac": mtool.Tool{tac.Run, "print strings from standard input in reversed order"},
"ls": mtool.Tool{ls.Run, "list directory content"},
"yes": mtool.Tool{yes.Run, "print string infinite/exact amount times"},
"date": mtool.Tool{date.Run, "print current date"},
"uniq": mtool.Tool{uniq.Run, "filter repeated strings"},
"quote": mtool.Tool{quote.Run, "quote words containing space characters"},
"urlprs": mtool.Tool{urlprs.Run, "parse URLs"},
"noext": mtool.Tool{noext.Run, "print file path without extension"},
"mergelbl": mtool.Tool{mergelbl.Run, "merge line by line"},
"ec": mtool.Tool{ec.Run, "render escape sequences"},
"read": mtool.Tool{read.Run, "read lines and exit"},
"wc": mtool.Tool{wc.Run, "count words, bytes, runes etc"},
"ftest": mtool.Tool{ftest.Run, "filter files by specified features"},
"range": mtool.Tool{grange.Run, "too lazy"},
"in": mtool.Tool{in.Run, "filter strings from stdin that aren not in arguments"},
"useprog": mtool.Tool{useprog.Run, "print the name of the first existing program in arg list"},
"path": mtool.Tool{path.Run, "print cross platform path based on cmd arguments"},
"mk": mtool.Tool{mk.Run, "file dependency system, simpler make"},
"awk": mtool.Tool{awk.Run, "simple scripting language for working with string templates"},
"paths": mtool.Tool{
paths.Run,
"convert UNIX slash separated paths into the OS compatible ones",
},
2023-02-26 13:12:40 +03:00
"whoami": mtool.Tool{
whoami.Run,
"print current user name",
},
2023-03-08 16:39:50 +03:00
"ln": mtool.Tool{
ln.Run,
"link files",
},
2022-08-06 05:45:08 +03:00
}
2022-10-11 15:55:26 +03:00
mtool.Main("goblin", tools)
2022-08-06 05:45:08 +03:00
}