What's wrong
BaseVerb.PathString defaults to "." (BaseVerb.cs:15). Scan.ValidateArgs decides whether to prompt by checking if (PathString is "." or "") (Scan.cs:23). That check can't tell "no -p given" apart from an explicit -p ., so the user's argument is thrown away.
Repro
cd ~/pics
ImageDescriber Scan -p . < /dev/null
# Enter the path to scan: No path provided. Aborting.
ImageDescriber Scan -p ./ and -p "$PWD" scan normally.
Why it matters
cd dir && ImageDescriber Scan -p . is the most natural way to run a scan from a script, cron job or scheduled task. It silently does nothing (see also #167, which covers the exit code being 0 even then). Run interactively, it re-asks for a path the user has just given.
Suggested fix
- Default
PathString to string.Empty (or make it string?), and prompt only when it is empty.
- Update the reset at Scan.cs:158 (
PathString = ".") to match, so the menu still prompts on its next Scan.
- Check that other users of
Path still get the current directory when nothing is given.
- Add a test that
Scan with PathString = "." set explicitly does not prompt.
What's wrong
BaseVerb.PathStringdefaults to"."(BaseVerb.cs:15).Scan.ValidateArgsdecides whether to prompt by checkingif (PathString is "." or "")(Scan.cs:23). That check can't tell "no-pgiven" apart from an explicit-p ., so the user's argument is thrown away.Repro
ImageDescriber Scan -p ./and-p "$PWD"scan normally.Why it matters
cd dir && ImageDescriber Scan -p .is the most natural way to run a scan from a script, cron job or scheduled task. It silently does nothing (see also #167, which covers the exit code being 0 even then). Run interactively, it re-asks for a path the user has just given.Suggested fix
PathStringtostring.Empty(or make itstring?), and prompt only when it is empty.PathString = ".") to match, so the menu still prompts on its next Scan.Pathstill get the current directory when nothing is given.ScanwithPathString = "."set explicitly does not prompt.