help: display current config

This commit is contained in:
dece 2021-05-13 01:26:10 +02:00
parent f63d875fc3
commit 62997b9385
3 changed files with 17 additions and 2 deletions

View file

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

View file

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

View file

@ -46,4 +46,18 @@ with arguments by pressing the corresponding keybind above.
* o/open <url>: open this URL * o/open <url>: open this URL
* forget_certificate <hostname>: remove saved fingerprint for the hostname * forget_certificate <hostname>: remove saved fingerprint for the hostname
* q/quit: well, quit * 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)