EmbarkStudios / texture-synthesis

🎨 Example-based texture synthesis written in Rust 🦀
http://embark.rs
Apache License 2.0
1.75k stars 83 forks source link

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

Closed vi closed 5 years ago

vi commented 5 years ago

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.

Jake-Shadle commented 5 years ago

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.

vi commented 5 years ago

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.