OpenParsec / openparsec

GNU General Public License v2.0
51 stars 8 forks source link

[Linux] Let parsec print the help (`--help`) into the terminal not into the log file #62

Closed mattthias closed 2 years ago

mattthias commented 2 years ago

Hi everyone,

while packaging openparsec i noticed that the --help command line parameter prints its output to the parsec.log. The file is created next to the parsec binary (https://github.com/OpenParsec/openparsec/issues/63). This doesn't work in case the openparsec binary is installed in a path where the calling user has no write permissions (That the binary must be started in the same directory where the assets are stored is a different issue that i mitigate at the moment with a shell wrapper).

The command line options are defined in https://github.com/OpenParsec/openparsec/blob/b17a6b4d98a451d2f158b9e331f1e5fc7689eabf/src/parsec/sl_opt.cpp#L77 and use the macro MSGOUT to output. I would suggest we use plain printf in this place to direct print the command line help.

I know, that the user base of openparsec isn't huge enough to talk about user experience tweaks :-D. But an output to ./parsec --help looks like a good idea.

I'll prepare a PR if noone objects.

uberlinuxguy commented 2 years ago

@mattthias go for it! I thought about making a ticket for this too, but since you are looking at it, we look forward to a PR.