From ef9adc92c8fc5192354a393a9d03e91fa64e87a8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Mar 2022 07:13:56 +0530 Subject: [PATCH] Note on how to use include for DRYer config --- docs/kittens/ssh.rst | 6 +++--- kittens/ssh/options/definition.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/kittens/ssh.rst b/docs/kittens/ssh.rst index 1583ed2d9..e4f425e4d 100644 --- a/docs/kittens/ssh.rst +++ b/docs/kittens/ssh.rst @@ -42,11 +42,11 @@ quick example: env COPIED_VAR=_kitty_copy_env_var_ # Create some per hostname settings - hostname *.myservers.net + hostname someserver-* copy env-files env SOMETHING=else - hostname somehost.org + hostname somehost copy --dest=foo/bar some-file copy --glob some/files.* @@ -66,7 +66,7 @@ editor, respectively: .. code-block:: conf # Have these settings apply to servers in my organization - hostname *.my-organization.net + hostname myserver-* # Setup zsh to read its files from my-conf/zsh env ZDOTDIR $HOME/my-conf/zsh diff --git a/kittens/ssh/options/definition.py b/kittens/ssh/options/definition.py index 165555627..3f3a31303 100644 --- a/kittens/ssh/options/definition.py +++ b/kittens/ssh/options/definition.py @@ -29,7 +29,9 @@ The hostname the following options apply to. A glob pattern to match multiple hosts can be used. When not specified options apply to all hosts, until the first hostname specification is found. Note that the hostname this matches against is the hostname used by the remote computer, not the name you pass -to SSH to connect to it. +to SSH to connect to it. If you wish to include the same configuration for many +different hosts, you can do so with the :code:`include` directive (see :doc:`conf`), +so that you need only two lines per host. ''') opt('+copy', '', option_type='copy', add_to_default=False, long_text=f'''