2022-06-16 09:02:24 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import(
|
2022-08-06 05:29:09 +03:00
|
|
|
"github.com/surdeus/gomtool/src/multitool"
|
2022-06-16 09:02:24 +03:00
|
|
|
"strconv"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
var(
|
|
|
|
tools = multitool.Tools{
|
2022-10-11 15:38:48 +03:00
|
|
|
"echo" : multitool.Tool{
|
|
|
|
func(args []string) {
|
|
|
|
fmt.Println(args)
|
|
|
|
},
|
|
|
|
"print string to standard output string",
|
2022-06-16 09:02:24 +03:00
|
|
|
},
|
2022-10-11 15:38:48 +03:00
|
|
|
"sum" : multitool.Tool{
|
|
|
|
func(args []string) {
|
|
|
|
one, _ := strconv.Atoi(args[1])
|
|
|
|
two, _ := strconv.Atoi(args[2])
|
|
|
|
fmt.Println(one + two)
|
|
|
|
},
|
|
|
|
"add one value to another",
|
2022-06-16 09:02:24 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
multitool.Main("test", tools)
|
|
|
|
}
|
|
|
|
|