mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-10 06:05:26 +02:00
Use a nicer decorator for functions that only need to be run once
This commit is contained in:
@@ -21,9 +21,10 @@ from .rc.base import (
|
||||
RemoteCommand, all_command_names, command_for_name,
|
||||
display_subcommand_help, parse_subcommand_cli
|
||||
)
|
||||
from .types import run_once
|
||||
|
||||
|
||||
@lru_cache(maxsize=2)
|
||||
@run_once
|
||||
def match_commands() -> Tuple[str, ...]:
|
||||
all_commands = tuple(sorted(x.replace('_', '-') for x in all_command_names()))
|
||||
return tuple(sorted(all_commands + ('exit', 'help', 'quit')))
|
||||
|
||||
Reference in New Issue
Block a user