mirror of
https://github.com/hymkor/lispect.git
synced 2026-08-28 04:46:59 -04:00
example.lsp: enable to specify options for ssh
This commit is contained in:
+5
-5
@@ -1,18 +1,18 @@
|
|||||||
(block main
|
(block main
|
||||||
(if (< (length *argv*) 2)
|
(if (< (length *argv*) 2)
|
||||||
(progn
|
(progn
|
||||||
(format (error-output) "Usage: ~A ~A USERNAME@DOMAIN PASSWORD~%" *executable-name* *program-name*)
|
(format (error-output) "Usage: ~A ~A {SSH-OPTIONS} USERNAME@DOMAIN PASSWORD~%" *executable-name* *program-name*)
|
||||||
(return-from main nil)))
|
(return-from main nil)))
|
||||||
|
|
||||||
(let ((account (car *argv*))
|
(let* ((ssh-param (subseq *argv* 0 (- (length *argv*) 1)))
|
||||||
(password (cadr *argv*))
|
(password (elt *argv* (- (length *argv*) 1)))
|
||||||
(sshpid nil))
|
(sshpid nil))
|
||||||
|
|
||||||
(with-handler
|
(with-handler
|
||||||
(lambda (c)
|
(lambda (c)
|
||||||
(format (error-output) "ssh is not found~%")
|
(format (error-output) "ssh is not found~%")
|
||||||
(setq sshpid (spawn "ssh" account)))
|
|
||||||
(return-from main nil))
|
(return-from main nil))
|
||||||
|
(setq sshpid (apply #'spawn "ssh" ssh-param)))
|
||||||
|
|
||||||
(expect*
|
(expect*
|
||||||
("[fingerprint])?"
|
("[fingerprint])?"
|
||||||
|
|||||||
Reference in New Issue
Block a user