EmbarkStudios / texture-synthesis

🎨 Example-based texture synthesis written in Rust 🦀

Home Page:http://embark.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI error message is unclear when `--` is in wrong place

vi opened this issue · comments

Describe the bug

Error message about wrong CLI usage is unclear

To Reproduce

$ texture-synthesis --out-size=171x248 --out=w.png -- generate q1.png 
error: The subcommand 'generate' wasn't recognized
	Did you mean 'generate'?

If you believe you received this message in error, try re-running with 'texture-synthesis -- generate'

USAGE:
    texture-synthesis --out-size <out-size> --out <output-path>

For more information try --help

Expected behavior

Error message helps me to fix the command line, not to substitude generate for generate.

The command line works if -- is removed. As -- is often present in README examples, probability that users would step on this is higher.

Yah, that's kind of an unfortunate suggestion, but it appears like is no simple way to fix this particular suggestion without turning suggestions off altogether.

However, the use of -- in the README is actually unnecessary with the current arguments, so I will just remove the unneeded usages of that, which should avoid (most) confusion.

Another CLI UI strangeness:

        --out-fmt <out-fmt>                       
            The format to save the generated image as.
            
            NOTE: this will only apply when stdout is specified via `-o -`, otherwise the image format is determined by
            the file extension of the path provided to `-o` [default: png]

Explicit command-line option should override any sort of auto-detection.