vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.85k stars 69 forks source link

Improve CLI Usage Error #101

Closed smolck closed 4 years ago

smolck commented 5 years ago

See #99.

Only current problem is that the error message says error: twice (on the first line):

error: error: Found argument '--test' which wasn't expected, or isn't valid in this context

USAGE:
    gnvim [FLAGS] [OPTIONS] [FILES]... [-- <ARGS>...]

For more information try --help
If this is an argument for nvim, try moving it after a -- separator.

I could do some string splitting to remove the double error: strings, but I doubt that's the best way. AFAIK it's caused by me using the description of the error here, and then calling exit() (which I think puts the error: part at the start of the description automatically). I could of course just put the usual message without the error: at the front into an &str (which is probably the best course of action; let me know what you think).

Any suggestions/feedback/etc. (especially on how to remove the extra error:) are appreciated.

vhakulinen commented 4 years ago

Merged in https://github.com/vhakulinen/gnvim/commit/5687ffce0b1f24b9e4c8aa1ba6336c5bd10426a4