summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/mkshtypes_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkglint/files/mkshtypes_test.go')
-rw-r--r--pkgtools/pkglint/files/mkshtypes_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgtools/pkglint/files/mkshtypes_test.go b/pkgtools/pkglint/files/mkshtypes_test.go
index 3a0b9963ba6..ea4d9916606 100644
--- a/pkgtools/pkglint/files/mkshtypes_test.go
+++ b/pkgtools/pkglint/files/mkshtypes_test.go
@@ -3,3 +3,14 @@ package pkglint
func (list *MkShList) AddSemicolon() *MkShList { return list.AddSeparator(sepSemicolon) }
func (list *MkShList) AddBackground() *MkShList { return list.AddSeparator(sepBackground) }
func (list *MkShList) AddNewline() *MkShList { return list.AddSeparator(sepNewline) }
+
+// AddCommand adds a command directly to a list of commands,
+// creating all the intermediate nodes for the syntactic representation.
+//
+// As soon as that representation is replaced with a semantic representation,
+// this method should no longer be necessary.
+func (list *MkShList) AddCommand(command *MkShCommand) *MkShList {
+ pipeline := NewMkShPipeline(false, []*MkShCommand{command})
+ andOr := NewMkShAndOr(pipeline)
+ return list.AddAndOr(andOr)
+}