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

NMODL subcommand order incompatible with find ... -exec [EXECUTABLE] {} + #1482

Open
JCGoran opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@JCGoran
Copy link
Contributor

JCGoran commented Sep 30, 2024

When using find, one often uses the syntax:

find ... -exec [EXECUTABLE] {} \;

as a shorthand for running [EXECUTABLE] [MATCH1];[EXECUTABLE] [MATCH2]; ... (single input file to [EXECUTABLE]), and:

find ... -exec [EXECUTABLE] {} +

as a shorthand for [EXECUTABLE] [MATCH1] [MATCH2] ... (multiple input files to [EXECUTABLE]).
The problem is that the latter does not work with NMODL subcommands:

$ find . -name '*.mod' -exec nmodl {} passes --nmodl-ast +
find: -exec: no terminating ";" or "+"
$ find . -name '*.mod' -exec nmodl passes --nmodl-ast {} +
file: File does not exist: passes
Run with --help or --help-all for more information.
$ find . -name '*.mod' -exec nmodl {} + passes --nmodl-ast
find: passes: unknown primary or operator

My guess is that there's an assumption in find that the input files are always the last part of the command, which isn't the case for NMODL. This can be a bit limiting since the two forms (with {} \; and with {} +) are not equivalent if there are any changes to the traversed dir done as a result of running [EXECUTABLE].
This is the case by default for NMODL (writes temp files in ${PWD}/tmp), but which can be circumvented by explicitly specifying --scratch-dir [DIR]. Would be nice not to have to use this workaround though.

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