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

displaying version on help command #2

Open
schettino72 opened this issue Mar 30, 2015 · 0 comments
Open

displaying version on help command #2

schettino72 opened this issue Mar 30, 2015 · 0 comments

Comments

@schettino72
Copy link
Owner

Now that commands can be plugged-in later, it would be better to make doc_description a method so as to be possible to override.

Just check cmd-graphx:line291. The version-discovery to be imprinted in the help-msg runs at import-time.

doc_description is used by doit help system as an attribute of Command instance (accessed as self.doc_description as opposed to MyCommand.doc_description ). That means it is possible to overwrite it with a method decorated as a @property. Since it hardly makes sense to have dynamic content on the description it is usually defined at class level with a static string.

For this specific case where the "dynamic" part is the version of the command I suggest we add a new version attribute member to command and let the help system assemble different parts of the help message as it already do with doc_purpose, doc_usage, doc_description. This way there would be no need for a method just to create doc_description.

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

No branches or pull requests

1 participant