Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something like argparse.build_manpages dict #7

Open
praiskup opened this issue Nov 23, 2017 · 3 comments
Open

Something like argparse.build_manpages dict #7

praiskup opened this issue Nov 23, 2017 · 3 comments
Labels

Comments

@praiskup
Copy link
Owner

It could look like

argparse.build_manpages = {
    'ENVIRONMENT' = {
        'description': """ The description... """,
        'vars': {
            'CONFIG_FOO': "Description for CONFIG_FOO",
        }
    },
}

Each item could mean new section?

@praiskup
Copy link
Owner Author

I think I would prefer something like this:

class ManpageMetadata:
    description = None
    section = None
 
    def __init__(self, parser):
        parser._some_private_pointer = self

The ManpageMetadata could have any continuously growing API, in a "declarative" manner. The Manpage then could on its own identify the parser._some_private_pointer and use the provided data.

praiskup added a commit that referenced this issue Oct 27, 2022
The definition of the data= is blurry, and it's better to not use it
from the outside, it could change.  Try to hide it from users (make it
optional and private), and actually revert a change that the old
Manpage() API.

Relates: #7
praiskup added a commit that referenced this issue Oct 27, 2022
The definition of the data= is blurry, and it's better to not use it
from the outside, it could change.  Try to hide it from users (make it
optional and private), and actually revert a change that the old
Manpage() API.

Relates: #7
@rrthomas
Copy link
Contributor

Does --include replace this?

@praiskup
Copy link
Owner Author

This RFE still seems appealing to me, even if we have --include. My plan was to migrate the https://github.com/fedora-copr/copr utilities to argparse-manpage generator, and see if this is or isn't needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants