Skip to content

Commit 89031ae

Browse files
authored
Add no interactions to list of output args (#114)
1 parent 0ab2989 commit 89031ae

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

optionsOutput.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,10 @@ func WithNoStylesheet() Option {
8585
s.args = append(s.args, "--no-stylesheet")
8686
}
8787
}
88+
89+
// WithNonInteractive disable runtime interactions via keyboard
90+
func WithNonInteractive() Option {
91+
return func(s *Scanner) {
92+
s.args = append(s.Args(), "--noninteractive")
93+
}
94+
}

optionsOutput_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ func TestOutput(t *testing.T) {
138138
"--no-stylesheet",
139139
},
140140
},
141+
{
142+
description: "disable interactions",
143+
144+
options: []Option{
145+
WithNonInteractive(),
146+
},
147+
148+
expectedArgs: []string{
149+
"--noninteractive",
150+
},
151+
},
141152
}
142153

143154
for _, test := range tests {

0 commit comments

Comments
 (0)