FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
15.95k stars 482 forks source link

Improve cmdline error messages #345

Closed puenka closed 2 years ago

puenka commented 2 years ago

I've added improved error messages and hints for the case flag.NArg() > 1. Assuming that the first entry of flag.Args is the file input, I check whether any of the following os.Args after the input start with -. In this case, I guess that the user has specified flags after the input (which is not allowed) and therefore suggest to them an alternative command by putting the current file input to the end of the argument chain. Otherwise - if no flag was found - I guess that the user tried to use multiple file names and print a hint that this is not allowed.

This should solve issue #160.

mikecook commented 2 years ago

Rerun build step, it appears Filo fixed the Github secret for osslsigncode certkey pass that failed this build.

mikecook commented 2 years ago

rebase on main and it should work now

FiloSottile commented 2 years ago

Thank you! I landed a tweaked version of this PR.