@@ -5,8 +5,8 @@ use crate::process::PtyProcess;
55use crate :: reader:: { NBReader , Regex } ;
66pub use crate :: reader:: { Options , ReadUntil } ;
77use std:: fs:: File ;
8- use std:: io:: LineWriter ;
98use std:: io:: prelude:: * ;
9+ use std:: io:: LineWriter ;
1010use std:: ops:: { Deref , DerefMut } ;
1111use std:: process:: Command ;
1212use tempfile;
@@ -212,12 +212,6 @@ impl PtySession {
212212 }
213213}
214214
215- /// Turn e.g. "prog arg1 arg2" into ["prog", "arg1", "arg2"]
216- /// Also takes care of single and double quotes
217- fn tokenize_command ( program : & str ) -> Result < Vec < String > , Error > {
218- comma:: parse_command ( program) . ok_or ( Error :: BadProgramArguments )
219- }
220-
221215/// Start command in background in a pty session (pty fork) and return a struct
222216/// with writer and buffered reader (for unblocking reads).
223217///
@@ -243,6 +237,12 @@ pub fn spawn(program: &str, timeout_ms: Option<u64>) -> Result<PtySession, Error
243237 spawn_command ( command, timeout_ms)
244238}
245239
240+ /// Turn e.g. "prog arg1 arg2" into ["prog", "arg1", "arg2"]
241+ /// Also takes care of single and double quotes
242+ fn tokenize_command ( program : & str ) -> Result < Vec < String > , Error > {
243+ comma:: parse_command ( program) . ok_or ( Error :: BadProgramArguments )
244+ }
245+
246246/// See [`spawn`]
247247pub fn spawn_command ( command : Command , timeout_ms : Option < u64 > ) -> Result < PtySession , Error > {
248248 spawn_with_options (
0 commit comments