Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

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

@JCGoran

Description

@JCGoran

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.

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