Skip to content

Bash (globstar) style globbing #1973

Closed
Closed
@hdgarrood

Description

@hdgarrood

Implement bash style filename globbing for data-files (well, bash after doing shopt -s globstar). Subsumes #1343 and #1344.

The plan:

  • * can expand to a part of any file or directory but not descend into subdirectories
  • ** is the same, except that it can match any number of levels of directories (including 0).
  • {a,b,c} can expand into a, b, or c, where a, b, and c are globs themselves. So {foo,*bar} expands to "foo" or "abar" or "bbar"...
  • "Literal" and glob patterns may be mixed to an unlimited extent in a single directory level. That is, foo/**/* is allowed, and so is foo/**/*.hs, and foo/**/Test*.hs, and foo/**/*{Test,Spec}*.hs.
  • Backslash \ may be used to match any of the charactes {, }, *, \ literally. Eg \\ matches \.

I intend to push some code for this in the near future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions