mangalar
A comfortable way of running many programs in a terminal. It aims to replace bash scripts.
Example
package main
import (
"github.com/bankole7782/mangalar"
"fmt"
)
var toExec = `
tar -zcvf f8_files.tar.gz \
$fn
tar -cJf f8_files.tar.xz $fn
tar -cJf f8_files2.tar.xz $fn
`
func main() {
mo, err := mangalar.InitMObject(toExec)
if err != nil {
panic(err)
}
err = mo.RunAll(map[string]string{"fn": "f8_files"})
if err != nil {
panic(fmt.Sprintf("%+v", err))
}
}
Notes
-
You create a multiline string containing all the programs you want to run seperated by newlines.
-
You pass the string in 1 to mangalar.InitMObject
.
-
You can then run all of the them even with the feature of simple variable substitution.