bb/src/cmd/goblin/main.go

61 lines
2.8 KiB
Go
Raw Normal View History

2022-08-06 05:45:08 +03:00
package main
import(
2022-10-11 15:55:26 +03:00
mtool "github.com/surdeus/gomtool/src/multitool"
2022-08-06 05:45:08 +03:00
"github.com/surdeus/goblin/src/tool/cat"
"github.com/surdeus/goblin/src/tool/echo"
"github.com/surdeus/goblin/src/tool/mkdir"
"github.com/surdeus/goblin/src/tool/gtrue"
"github.com/surdeus/goblin/src/tool/gfalse"
"github.com/surdeus/goblin/src/tool/sort"
"github.com/surdeus/goblin/src/tool/tac"
"github.com/surdeus/goblin/src/tool/ls"
"github.com/surdeus/goblin/src/tool/yes"
"github.com/surdeus/goblin/src/tool/date"
"github.com/surdeus/goblin/src/tool/uniq"
"github.com/surdeus/goblin/src/tool/quote"
"github.com/surdeus/goblin/src/tool/urlprs"
"github.com/surdeus/goblin/src/tool/noext"
"github.com/surdeus/goblin/src/tool/mergelbl"
"github.com/surdeus/goblin/src/tool/basename"
"github.com/surdeus/goblin/src/tool/ec"
"github.com/surdeus/goblin/src/tool/read"
"github.com/surdeus/goblin/src/tool/wc"
"github.com/surdeus/goblin/src/tool/ftest"
"github.com/surdeus/goblin/src/tool/grange"
2022-11-14 17:15:02 +03:00
"github.com/surdeus/goblin/src/tool/in"
2022-11-21 01:27:21 +03:00
"github.com/surdeus/goblin/src/tool/useprog"
2023-01-27 19:23:11 +03:00
"github.com/surdeus/goblin/src/tool/path"
2022-08-06 05:45:08 +03:00
)
func main() {
2022-10-11 15:55:26 +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"},
2022-11-14 17:15:02 +03:00
"in" : mtool.Tool{in.Run, "filter strings from stdin that aren not in arguments"},
2022-11-21 01:27:21 +03:00
"useprog" : mtool.Tool{useprog.Run, "print the name of the first existing program in arg list"},
2023-01-27 19:23:11 +03:00
"path" : mtool.Tool{path.Run, "print cross platform path based on cmd arguments"},
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
}