Implemented basic path util.
This commit is contained in:
parent
aac4f7f5cd
commit
82ccc253d2
2 changed files with 14 additions and 0 deletions
|
@ -25,6 +25,7 @@ import(
|
|||
"github.com/surdeus/goblin/src/tool/grange"
|
||||
"github.com/surdeus/goblin/src/tool/in"
|
||||
"github.com/surdeus/goblin/src/tool/useprog"
|
||||
"github.com/surdeus/goblin/src/tool/path"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -52,6 +53,7 @@ func main() {
|
|||
"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"},
|
||||
}
|
||||
|
||||
mtool.Main("goblin", tools)
|
||||
|
|
12
src/tool/path/main.go
Normal file
12
src/tool/path/main.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package path
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func Run(args []string) {
|
||||
path := filepath.Join(args[1:]...)
|
||||
fmt.Print(path)
|
||||
}
|
||||
|
Loading…
Reference in a new issue