ESMCI / git-fleximod

MIT License
2 stars 2 forks source link

Suggestions for manpage update #9

Closed negin513 closed 5 months ago

negin513 commented 5 months ago

The man page building with argparse-manpage was not working due to a few issues. Most importantly the argparse-manpage creates the man page from ArgumentParser object or a parser function. The issue was that here you were not pointing to the correct pyfile and ArgumentParser object.

Here I updated the setup.cfg file to show two different possible solutions that required minimal work:

  1. Using a parser function, such as commandline_arguments.

    [build_manpages]
    manpages =
    # solution 1: -- Using the parser function, requires slight modifications to split up the commandline_arguments parser
    man/git-fleximod.1:function:commandline_arguments:pyfile=src/git-fleximod

    This solution use a parser function but we could not directly use commandline_arguments as it have some condition checking and failed as it was due to missing arguments. I splitted up the commandline_arguments function to two functions (one that return the ArgumentParser object and one that does the rest of the processing and option checking.

  2. Making the ArgumentParser object global object in git-fleximod and using it instead:

manpages =
        man/git-fleximod.2:pyfile=src/git-fleximod:object=parser

I updated this PR to use solution 1 as the better option but I just wanted you to be aware of solution 2.

jedwards4b commented 5 months ago

Closing unused.