Lets the user specify a path for a script output, optionally with a custom name.
I need to check but it should enable the user to specify a directory as output.
If that’s a good idea is an other question.
Given a glob pattern, walk up the path tree until we find a component
that contains no glob metacharacters (*, ?, [). The result is
a concrete directory (or .) suitable as a WalkDir root.