summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-06-04 01:03:20 +0700
committerShulhan <m.shulhan@gmail.com>2020-06-04 01:03:20 +0700
commit9bf6863448581351232dcdc5aa06a50907542f60 (patch)
tree6131fc5454937dc25b607f67a76e4196c0d727ff
parentb415c48406b5cfdf9014d98d9a3e857dc0318eb5 (diff)
downloadawwan-9bf6863448581351232dcdc5aa06a50907542f60.tar.xz
command: merge sequences of spaces on command into single space
-rw-r--r--CHANGELOG.adoc2
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--script.go3
4 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 79e157b..db58a89 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -4,6 +4,8 @@
=== Enhancements
+* command: merge sequences of spaces on command into single space
+
* command: check for single, double, or back quote on command
Previously, if command contains quote like,
diff --git a/go.mod b/go.mod
index cf36b00..dba971b 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module git.sr.ht/~shulhan/awwan
go 1.13
require (
- github.com/shuLhan/share v0.15.1-0.20200603172616-427251e6f320
+ github.com/shuLhan/share v0.15.1-0.20200603175945-47ade84e63eb
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 // indirect
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 // indirect
)
diff --git a/go.sum b/go.sum
index 1636647..5a1a7a6 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/shuLhan/share v0.15.1-0.20200603172616-427251e6f320 h1:7JaEmvHHh5miPgpsOtlgczWyKziI4x+sy16njqdtUVs=
-github.com/shuLhan/share v0.15.1-0.20200603172616-427251e6f320/go.mod h1:mpa0ub5qmuko/muUlOROOqLCSHKU76GzuAR/sUaSwRo=
+github.com/shuLhan/share v0.15.1-0.20200603175945-47ade84e63eb h1:S+GJUL/QzPNsNBQj76YLIc34c/BJlhRPeil6Kdu2+PI=
+github.com/shuLhan/share v0.15.1-0.20200603175945-47ade84e63eb/go.mod h1:mpa0ub5qmuko/muUlOROOqLCSHKU76GzuAR/sUaSwRo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8=
diff --git a/script.go b/script.go
index 40244b5..4180c3e 100644
--- a/script.go
+++ b/script.go
@@ -9,6 +9,8 @@ import (
"io/ioutil"
"log"
"text/template"
+
+ libbytes "github.com/shuLhan/share/lib/bytes"
)
//
@@ -109,6 +111,7 @@ func (s *script) join() {
break
}
}
+ s.Statements[x] = libbytes.MergeSpaces(s.Statements[x])
x = y
}
}