Summary
Running mdfried with a shell glob that expands to more than one path
fails with clap's generic error: unexpected argument ... found, which
does not explain that mdfried accepts only a single source at a time.
Reproduction
touch a.md b.md
mdfried *.md
or, in a directory tree where multiple files match:
Actual
error: unexpected argument 'firefox-extension-efficient-tab-manager/PROPOSAL.md' found
Usage: mdfried [OPTIONS] [SOURCE]
For more information, try '--help'.
The user is left guessing that the issue is too many positional arguments
or that they need to quote the glob.
Expected
A message that points at the most common cause — a shell glob expanding
to multiple paths — and suggests either quoting the glob or running
mdfried once per file. Something like:
error: mdfried accepts a single source. If you used a shell glob, quote it
(e.g. mdfried '**/*.md') or run mdfried once per file.
Exit code should stay 2 (matches clap's default for argument errors).
Environment
- mdfried 0.22.4
- Linux (any shell that performs glob expansion — bash, zsh, fish, etc.)
Notes
- The
[SOURCE] positional is correctly defined as taking exactly one
value. The problem is purely the error message — the second and later
paths surface as 'unexpected argument' with no hint about the real
cause.
- Unknown flags (
--foo) should keep clap's normal error, since the
hint about a single source would be misleading there.
Summary
Running
mdfriedwith a shell glob that expands to more than one pathfails with clap's generic
error: unexpected argument ... found, whichdoes not explain that mdfried accepts only a single source at a time.
Reproduction
touch a.md b.md mdfried *.mdor, in a directory tree where multiple files match:
Actual
The user is left guessing that the issue is too many positional arguments
or that they need to quote the glob.
Expected
A message that points at the most common cause — a shell glob expanding
to multiple paths — and suggests either quoting the glob or running
mdfried once per file. Something like:
Exit code should stay
2(matches clap's default for argument errors).Environment
Notes
[SOURCE]positional is correctly defined as taking exactly onevalue. The problem is purely the error message — the second and later
paths surface as 'unexpected argument' with no hint about the real
cause.
--foo) should keep clap's normal error, since thehint about a single source would be misleading there.