help: display current config

exec
dece 3 years ago
parent f63d875fc3
commit 62997b9385

@ -48,3 +48,4 @@ gopher?
opt. maintain history between sessions
history (forward) (useful?)
search in page (ugh)
get/set config using command-line

@ -17,8 +17,8 @@ from bebop.bookmarks import (
from bebop.colors import ColorPair, init_colors
from bebop.command_line import CommandLine
from bebop.external import open_external_program
from bebop.help import HELP_PAGE
from bebop.fs import get_identities_list_path
from bebop.help import get_help
from bebop.history import History
from bebop.identity import load_identities
from bebop.links import Links
@ -593,7 +593,7 @@ class Browser:
def open_help(self):
"""Show the help page."""
self.open_internal_page("help", HELP_PAGE)
self.open_internal_page("help", get_help(self.config))
def prompt(self, text, keys):
"""Display the text and allow it to type one of the given keys."""

@ -46,4 +46,18 @@ with arguments by pressing the corresponding keybind above.
* o/open <url>: open this URL
* forget_certificate <hostname>: remove saved fingerprint for the hostname
* q/quit: well, quit
## Configuration
The current configuration is:
{config_list}
"""
def get_help(config):
config_list = "\n".join(
f"* {key} = {value}"
for key, value in config.items()
)
return HELP_PAGE.format(config_list=config_list)

Loading…
Cancel
Save