[FEATURE] Added -man parameter to generate manual page for ccextractor using help2man#878
[FEATURE] Added -man parameter to generate manual page for ccextractor using help2man#878mahalwal wants to merge 5 commits intoCCExtractor:masterfrom mahalwal:master
Conversation
| } | ||
| if (strcmp (argv[i], "-")==0 || strcmp(argv[i], "-stdin") == 0) | ||
| { | ||
| #ifdef WIN32 |
There was a problem hiding this comment.
Minimum two spaces were required after every parameter so that help2man is able to detect different options.
| mprint("Finished executing man script\n"); | ||
| #endif | ||
| return EXIT_WITH_HELP; | ||
| } |
There was a problem hiding this comment.
This is a really really weird solution - if ccextractor (the binary) cannot generate the man page directly, then the correct way to generate it would be for manscript.sh to call ccextractor -help to get the output, and then do the transformation from the script, generate the man page, and possibly install it (if a install parameter is present).
Otherwise you're forcing the user to have manscript.sh around. Where would be this file be? ccextractor usually goes in /usr/local/bin or /usr/bin, but a file called manscript.sh doesn't really go there...
There was a problem hiding this comment.
I agree with this. It seems a weird solution, and it makes quite a lot of assumptions.
| mprint (" -fixptsjumps: fix pts jumps. Use this parameter if you\n"); | ||
| mprint (" experience timeline resets/jumps in the output.\n"); | ||
| mprint (" -stdin: Reads input from stdin (console) instead of file.\n"); | ||
| mprint (" inputfile: file(s) to process\n"); |
There was a problem hiding this comment.
Why all those extra spaces in the help? Are they needed for the man?
Did you check that every line is still below 80 chars?
There was a problem hiding this comment.
Atleast 2 spaces are required after every param for help2man to differentiate b/w the parameter and the the description.
|
|
||
| exechelp2man="help2man --section 7 --include=replace.h2m ./ccextractor > ccextractor.7" | ||
| echo $exechelp2man | ||
| eval $exechelp2man |
There was a problem hiding this comment.
Why are you using eval? There are most likely nicer ways available than this.
| eval $exechelp2man | ||
|
|
||
| mkdir -p /usr/local/man/man7 | ||
| sudo cp ccextractor.7 /usr/local/man/man7/ |
There was a problem hiding this comment.
Assuming a user has sudo available doesn't seem to wise. It'd be better to request the script to be executed with sudo or as root instead, and have a check for it.
| mprint ("CCExtractor %s, Carlos Fernandez Sanz, Volker Quetschke.\n", VERSION); | ||
| mprint ("Teletext portions taken from Petr Kutalek's telxcc\n"); | ||
| mprint ("--------------------------------------------------------------------------\n"); | ||
| // mprint ("--------------------------------------------------------------------------\n"); |
There was a problem hiding this comment.
Why is this line commented out?
There was a problem hiding this comment.
For proper formatting in the man pages. This was not looking good
|
I am closing this PR and I'll send another one with the requested changes.
So is there a way we can update the roff file generated by help2man everytime someone updates the output from --help or --version? |
Please prefix your pull request with one of the following: [FEATURE] [FIX] [IMPROVEMENT].
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
I have added the -man parameter which generates the man page using help2man (dependency).
help2man uses the output from --help and --version of CCExtractor's executable.
This pull request supports man pages only for Linux users. I will add support for mac as well as other users after someone provides their feedback on this pull.