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

cmdline: add listconfig/helpconfig #9034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

cmdline: add listconfig/helpconfig #9034

wants to merge 1 commit into from

Conversation

ecdsa
Copy link
Member

@ecdsa ecdsa commented Apr 30, 2024

This adds commands to view the list of config variables

@accumulator
Copy link
Member

These commands should not require a running daemon, but currently require either a running daemon or an explicit --offline (but I guess this applies to more commands, as e.g. setconfig/getconfig also require --offline currently)

@accumulator
Copy link
Member

minor nitpick: helpconfig use_gossip returns Use trampoline routing

@ecdsa
Copy link
Member Author

ecdsa commented May 1, 2024

The --offline syntax requirement is off-topic. This syntax is explicitly needed for all commands, regardless of whether they use the network, because it clarifies whether the command uses the running daemon or not.

Comment on lines +361 to +364
async def helpconfig(self, key, more=False):
"""Returns help about a configuration variable. """
cv = self.config.cv.from_key(key)
return cv.get_long_desc() if more else cv.get_short_desc()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we need the --more option. How about combining the two descriptions?
e.g.:

Suggested change
async def helpconfig(self, key, more=False):
"""Returns help about a configuration variable. """
cv = self.config.cv.from_key(key)
return cv.get_long_desc() if more else cv.get_short_desc()
async def helpconfig(self, key):
"""Returns help about a configuration variable. """
cv = self.config.cv.from_key(key)
short = cv.get_short_desc()
long = cv.get_long_desc()
if short and long:
return short + "\n---\n\n" + long
else:
return short or long

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

Successfully merging this pull request may close these issues.

3 participants