Work on parsing copy instructions

This commit is contained in:
Kovid Goyal
2022-02-27 22:54:50 +05:30
parent 77c9affc00
commit fadae42715
4 changed files with 77 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
# generated by gen-config.py DO NOT edit
import typing
import kittens.ssh.copy
import kitty.cli_stub
option_names = ( # {{{
@@ -12,7 +12,7 @@ class Options:
hostname: str = '*'
remote_dir: str = '.local/share/kitty-ssh-kitten'
shell_integration: str = 'inherit'
copy: typing.Dict[str, kittens.ssh.copy.CopyInstruction] = {}
copy: typing.Dict[str, kitty.cli_stub.CLIOptions] = {}
env: typing.Dict[str, str] = {}
config_paths: typing.Tuple[str, ...] = ()
config_overrides: typing.Tuple[str, ...] = ()

View File

@@ -1,11 +1,12 @@
#!/usr/bin/env python
# License: GPLv3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
from typing import Any, Dict, Optional, Iterable, Tuple
import posixpath
from typing import Any, Dict, Iterable, Optional, Tuple
from ..copy import CopyInstruction
from kitty.cli_stub import CopyCLIOptions
from ..copy import parse_copy_instructions
DELETE_ENV_VAR = '_delete_this_env_var_'
@@ -32,8 +33,8 @@ def env(val: str, current_val: Dict[str, str]) -> Iterable[Tuple[str, str]]:
yield val, DELETE_ENV_VAR
def copy(val: str, current_val: Dict[str, str]) -> Iterable[Tuple[str, CopyInstruction]]:
pass
def copy(val: str, current_val: Dict[str, str]) -> Iterable[Tuple[str, CopyCLIOptions]]:
yield from parse_copy_instructions(val)
def init_results_dict(ans: Dict[str, Any]) -> Dict[str, Any]: