mirror of
https://github.com/sbrow/ps.git
synced 2026-02-28 03:01:43 -05:00
Added functionality
lib - Save - DoAction - ApplyDataset - GetLayer(s) main - do actions from commandline Improved test cases!
This commit is contained in:
27
cmd/ps/main.go
Normal file
27
cmd/ps/main.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/sbrow/ps"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := []string{}
|
||||
cmd := ""
|
||||
switch {
|
||||
case len(os.Args) > 1:
|
||||
args = os.Args[2:]
|
||||
fallthrough
|
||||
case len(os.Args) > 0:
|
||||
cmd = os.Args[1]
|
||||
}
|
||||
|
||||
fmt.Println(os.Args, cmd, args)
|
||||
if cmd == "action" {
|
||||
err := ps.DoAction(args[0], args[1])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user