From 029d66a8b8c6c2f203aa208a3590be31cd3f9b45 Mon Sep 17 00:00:00 2001 From: surdeus Date: Wed, 21 Jun 2023 11:03:56 +0300 Subject: [PATCH] ... --- check.anko | 4 +++- src/tool/script/main.go | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/check.anko b/check.anko index 6598ad0..732c8e3 100644 --- a/check.anko +++ b/check.anko @@ -2,7 +2,9 @@ e = 5 v = 53 println(e + v) -println("cock", Cmd("ls").Stdout()) +for v in Cmd("ls").Stdout().ShSplit() { + println("file:", v) +} if v < 55 { println("it fucking works") diff --git a/src/tool/script/main.go b/src/tool/script/main.go index 579435b..719538c 100644 --- a/src/tool/script/main.go +++ b/src/tool/script/main.go @@ -37,12 +37,23 @@ var ( args []string e *env.Env //flag *mtool.Flags + // Standard shell separators. + shSeps = "\t\r\n " ) func (o Output) String() string { return string(o) } +func (o Output) ShSplit() []string { + return strings.Fields(string(o)) +} + +func (o Output) Split(sep string) []string { + return strings.Split(o.String(), sep) +} + + func Run(flagSet *mtool.Flags) { printVersion := flagSet.Bool("v", false, "prints out the version and then exits")