yandex-cloud / geesefs

Finally, a good FUSE FS implementation over S3
Other
697 stars 45 forks source link

`geesefs --help` prints to stderr and returns exit value 1 #62

Open eriksjolund opened 1 year ago

eriksjolund commented 1 year ago

Describe the results you received:

$ geesefs --help 2> /dev/null
$ echo $?
1

Describe the results you expected:

I would have expected to see the help text written to stdout and the exit value to be zero.

Extra information:

$ geesefs --version
geesefs version 0.34.2
$
$ geesefs 2>&1 | grep -- --help
   --help, -h               Print this help text and exit successfully.
$
vitalif commented 1 year ago

Hi, this is the behaviour of https://github.com/urfave/cli. In fact it's more or less standard in Go (check go -h :)), but I agree that printing to stdout would be better. So maybe I'll try to change it

eriksjolund commented 1 year ago

Yes, you are right, go -h prints to stderr

$ rpm -qf /usr/bin/go
golang-bin-1.19.3-2.fc37.x86_64
$ /usr/bin/go -h 2> /dev/null
$ 

I noticed another thing. Geesefs complains about the number of arguments when running geesefs --help.

$ geesefs --help 2>&1 | head -1
Error: geesefs takes exactly two arguments.