Skip to content

Commit f48d79b

Browse files
authored
feat(cli): assume .tape extension in filename arg if omitted (#654)
1 parent e9c41d3 commit f48d79b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ var (
6363
// Set the input to the file contents if a file is given
6464
// otherwise, use stdin
6565
if len(args) > 0 && args[0] != "-" {
66-
in, err = os.Open(args[0])
66+
filename := args[0]
67+
if !strings.HasSuffix(filename, extension) {
68+
filename = filename + extension
69+
}
70+
in, err = os.Open(filename)
6771
if err != nil {
6872
return err
6973
}

0 commit comments

Comments
 (0)