File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,23 @@ pub trait OverSsh {
59
59
impl OverSsh for std:: process:: Command {
60
60
/// Given a session, convert a std::process::Command into an `openssh::Command`
61
61
/// that can be executed over that session.
62
+ /// ```no_run
63
+ /// use std::process::Command;
64
+ /// use openssh::{Session, KnownHosts, OverSsh};
65
+
66
+ /// let session = Session::connect_mux("me@ssh.example.com", KnownHosts::Strict).await?;
67
+ /// let ls =
68
+ /// Command::new("ls")
69
+ /// .arg("-l")
70
+ /// .arg("-a")
71
+ /// .arg("-h")
72
+ /// .with_session(&session)
73
+ /// .output()
74
+ /// .await?;
75
+ /// assert!(String::from_utf8(ls.stdout).unwrap().contains("total"));
76
+ ///
77
+ ///
78
+ /// ```
62
79
fn with_session < ' session > ( & self , session : & ' session Session ) -> Result < Command < ' session > , Error > {
63
80
let program =
64
81
self
You can’t perform that action at this time.
0 commit comments