Since the --is-reflink mode (documented as a "stand-alone command") uses the main option parsing code, it behaves differently from what the docs suggest.
Steps to Reproduce
$ touch a
$ touch b
$ ls rmlint.sh rmlint.json
ls: cannot access 'rmlint.sh': No such file or directory
ls: cannot access 'rmlint.json': No such file or directory
$ rmlint --is-reflink a b -o summary:stdout
$ ls rmlint.sh rmlint.json
ls: cannot access 'rmlint.sh': No such file or directory
ls: cannot access 'rmlint.json': No such file or directory
$ rmlint --is-reflink a b
$ ls rmlint.sh rmlint.json
rmlint.json rmlint.sh
Actual Behavior
rmlint --is-reflink accepts the -o option, and creates useless output files unless -o is used.
Expected Behavior
I would expect rmlint --is-reflink to behave like a subcommand. It should accept only the options -v and -V as per the documentation, and should not call rm_cmd_set_outputs -> rm_cmd_set_default_outputs -> rm_fmt_add(session->formats, "sh", "rmlint.sh").
Since the
--is-reflink
mode (documented as a "stand-alone command") uses the main option parsing code, it behaves differently from what the docs suggest.Steps to Reproduce
Actual Behavior
rmlint --is-reflink
accepts the-o
option, and creates useless output files unless-o
is used.Expected Behavior
I would expect
rmlint --is-reflink
to behave like a subcommand. It should accept only the options-v
and-V
as per the documentation, and should not callrm_cmd_set_outputs
->rm_cmd_set_default_outputs
->rm_fmt_add(session->formats, "sh", "rmlint.sh")
.It could at least be special-cased like
--dedupe
is here: https://github.com/sahib/rmlint/blob/6abfba9af35dd89f6dc82bbfdf5957875a19db15/lib/cmdline.c#L1604-L1607But this TODO is over three years old, maybe it's time for it to be resolved? https://github.com/sahib/rmlint/blob/6abfba9af35dd89f6dc82bbfdf5957875a19db15/lib/cmdline.c#L1538-L1549
Software Versions
rmlint 2.10.1