Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename patterns #96

Open
edemaine opened this issue Sep 29, 2022 · 0 comments
Open

Filename patterns #96

edemaine opened this issue Sep 29, 2022 · 0 comments

Comments

@edemaine
Copy link
Owner

edemaine commented Sep 29, 2022

#74 and #84/#99 already need support for globs like *.asc as input to SVG Tiler (not processed by the shell). This should be easy to add with the same library that svgink uses, so no additional dependency.

But it feels common to want to compile *.asc except simple_*.asc or something like that. Here are some ideas for how to specify these:

  1. Support regular expressions for filenames. For example: /^(?!simple_).*\.asc$/. (Pretty ugly, but pretty powerful.)
  2. -i/--ignore command-line option that ignores specified inputs until the next ). For example: -i simple_* *.asc.
  3. {/} for specifying a set of filenames using a collection of glob specs. For example: { *.asc !simple_* }
    • Unambiguous with {a,b} glob spec (which expands to a b) because of the spaces, which keep the {/}s in separate arguments
    • Similar to multiple lines of .gitignore (and with Maketiles: Config files like Makefiles #84 it could even be multiple lines): positive patterns union in (or should they intersect?), negative patterns subtract out.
  4. Maketiles (Maketiles: Config files like Makefiles #84) could build up sets of filenames like this:
    inputs = *.asc
    simple_inputs = $inputs
    simple_inputs &= simple_*
    inputs -= simple_inputs
    Actually, this inspired the design of Maketile v2 #99.
  5. Inspired by the operators in Option 4, you could also allow them in the command line. Maybe with braces like { *.asc & !simple_* }, or maybe bare like *.asc & !simple_* or *.asc - simple_* (via lookahead of 1?).
    • It's a little unclear how this works in more complicated scenarios. For example, what does *.asc *.xls - simple_* mean? And how would you parenthesize to force a particular meaning? I'd rather not have lookahead of more than 1 (even 1 is pushing it).
    • Maybe should use {/} for parenthesization, and require it, as in: { { *.asc | *.xls } - simple_* } (equivalent to { *.{asc,xls} - simple_* }).
    • Yev doesn't like the double use of {/} here (despite technical unambiguity). [/] would also be a possibility.

Currently I like Option 5 the most.

But this is all less important now that we have Maketile.coffee (#99).

@edemaine edemaine mentioned this issue Oct 5, 2022
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant