Skip to content

Commit

Permalink
Merge pull request #480 from noborus/windows-glob
Browse files Browse the repository at this point in the history
Enabled wildcard specification even on Windows
  • Loading branch information
noborus authored Jan 9, 2024
2 parents 8b2a28c + 95fae07 commit 0bc88ba
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,23 @@ func Completion(cmd *cobra.Command, arg string) error {
return ErrCompletion
}

func argsToFiles(args []string) []string {
var files []string
for _, arg := range args {
argFiles, err := filepath.Glob(arg)
if err != nil {
fmt.Fprintln(os.Stderr, err)
continue
}
files = append(files, argFiles...)
}
return files
}

// RunOviewer displays the argument file.
func RunOviewer(args []string) error {
ov, err := oviewer.Open(args...)
files := argsToFiles(args)
ov, err := oviewer.Open(files...)
if err != nil {
return err
}
Expand Down

0 comments on commit 0bc88ba

Please sign in to comment.