summaryrefslogtreecommitdiff
path: root/doc/api-sessions.texi
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-12-01 15:24:12 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-12-01 15:24:12 +0300
commit1673d06dff3678aa88af9dd2d28931274a8de4b2 (patch)
treea5bb3a1484cf33f659d667563efd8e955828a017 /doc/api-sessions.texi
parentNEWS: Update (diff)
downloadguile-ssh-1673d06dff3678aa88af9dd2d28931274a8de4b2.tar.gz
session.scm: Implement SSH config parsing
* modules/ssh/session.scm (make-session): Accept 'config' option. (session-parse-config!): New procedure. * libguile-ssh/session-func.c (gssh_session_parse_config): New procedure. * tests/common.scm (%config): Export the new global symbol. * doc/api-sessions.texi: Update. * tests/config: Add to the repository. * tests/session.scm ("session-parse-config!"): New test case. * NEWS: Update.
Diffstat (limited to 'doc/api-sessions.texi')
-rw-r--r--doc/api-sessions.texi28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/api-sessions.texi b/doc/api-sessions.texi
index b150f64..7330d92 100644
--- a/doc/api-sessions.texi
+++ b/doc/api-sessions.texi
@@ -223,10 +223,38 @@ slower.
Set callbacks that will be called on related events (@pxref{Callbacks}.)
Expected type of @var{value}: an association list (alist).
+
+@item config
+The option specifies whether an SSH config should be parsed or not, and
+optionally the path to a config file.
+
+Setting the @var{value} to @code{#t} means that the default
+@file{~/.ssh/config} should be parsed; in turn, setting the option to
+@code{#f} (the default value) means that the config should not be parsed at
+all. If the value is a string, then the string is expected to be a path to
+config file.
+
+The procedure reads the config file after all other specified options are set.
+When the config file is read, the options for @var{session} are set,
+overwriting those that were passed to the procedure.
+
+You @emph{must} specify at least a host name when using this option, otherwise
+the procedure will fail.
+
+Optionally you could use @code{session-parse-config!} procedure explicitly to
+read the config (see below.)
+
+Expected types of @var{value}: Either a string or a boolean value.
@end table
@end deffn
+@deffn {Scheme Procedure} session-parse-config! session [file-name]
+Parse an SSH config @var{file-name} and set @var{session} options. If
+@var{file-name} is not set, the default SSH @file{~/.ssh/config} is used.
+Throw @code{guile-ssh-error} on an error. Return value is undefined.
+@end deffn
+
@deffn {Scheme Procedure} session-get session option
Get value of the @var{option} for @var{session}. The @var{option} is expected
to be a symbol.