Function: tramp-nspawn--completion-function

tramp-nspawn--completion-function is a byte-compiled function defined in tramp-container.el.gz.

Signature

(tramp-nspawn--completion-function METHOD)

Documentation

List systemd-nspawn containers available for connection.

This function is used by tramp-set-completion-function, please see its function help for a description of the format.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-container.el.gz
(defun tramp-nspawn--completion-function (method)
  "List systemd-nspawn containers available for connection.

This function is used by `tramp-set-completion-function', please
see its function help for a description of the format."
  (tramp-skeleton-completion-function method
    (when-let* ((raw-list
		 (shell-command-to-string (concat program " list --all -q")))
		;; Ignore header line.
		(lines (cdr (split-string raw-list "\n")))
		(first-words
		 (mapcar (lambda (line) (car (split-string line))) lines))
		(machines (seq-take-while (lambda (name) name) first-words)))
      (mapcar (lambda (m) (list nil m)) machines))))