updated README.md

This commit is contained in:
Darko Luketic 2016-08-02 15:36:02 +02:00
parent f389fab3d7
commit 4f12162ff5

View File

@ -9,6 +9,7 @@ b2e -s="source path" -d="destination file"
default values are
s = ".\"
d = ".\bash.go"
## licence
@ -17,4 +18,72 @@ MIT
## Author
Darko Luketic
Darko Luketic
## Example Output
```go
package bash
import (
"os"
"os/exec"
)
func DiskusageCommand() error {
cmd := exec.Command("du", "-h")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if e := cmd.Start(); e != nil {
return e
}
if e := cmd.Wait(); e != nil {
return e
}
cmd = exec.Command("mkdir", "-p", "/var/lib/go")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if e := cmd.Start(); e != nil {
return e
}
if e := cmd.Wait(); e != nil {
return e
}
cmd = exec.Command("go", "get", "-u")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if e := cmd.Start(); e != nil {
return e
}
if e := cmd.Wait(); e != nil {
return e
}
}
func ListCommand() error {
cmd := exec.Command("ls", "-lah")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if e := cmd.Start(); e != nil {
return e
}
if e := cmd.Wait(); e != nil {
return e
}
cmd = exec.Command("df", "-h")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if e := cmd.Start(); e != nil {
return e
}
if e := cmd.Wait(); e != nil {
return e
}
}
```