Skip to content

Commit 2df2cbd

Browse files
authored
Handle return after getArgs (#52)
1 parent d767b08 commit 2df2cbd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ func _main() error {
337337
return err
338338
}
339339

340+
// Some commands exit naturally here. Like -h and -v
341+
if args == nil {
342+
return nil
343+
}
344+
340345
lastNonFlagArg := ""
341346
files := args.nonFlagArgs
342347

scripts/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ def test(name, to_run, want, fail=False, sort=False, winSkip=False, within_secon
171171
want = '[{"COUNT(*)":25}]'
172172
test("Supports Avro files", to_run, want, sort=True)
173173

174+
# Version test
175+
to_run = """./dsq -v"""
176+
want_stderr = "dsq latest\n"
177+
test("Shows version and quits", to_run, want="", want_stderr=want_stderr)
178+
174179
# Pretty column order
175180
to_run = """./dsq --pretty testdata/path/path.json 'SELECT name, id FROM {"data.data"}'"""
176181
want = """+----+-------+

0 commit comments

Comments
 (0)