| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
chore!: timeout now has type std::time::Duration
This is not a chore but a fix.
Sorry, something went wrong.
| } | ||
|
|
||
| /// See `spawn` | ||
| pub fn spawn_with_options(command: Command, options: Options) -> Result<PtySession, Error> { |
There was a problem hiding this comment.
This commit is a breaking change but isn't marked as such
Sorry, something went wrong.
|
|
||
| /// Process factory, which can be used in order to configure the properties of a command. | ||
| #[derive(Default)] | ||
| pub struct Builder { |
There was a problem hiding this comment.
Normally a builder gets named for what it is building, so PtySessionBuilder
Sorry, something went wrong.
| #[derive(Default)] | ||
| pub struct Builder { | ||
| /// A command to spawn | ||
| pub(super) command: Option<Command>, |
There was a problem hiding this comment.
pub(super) doesn't seem to be needed
Sorry, something went wrong.
| /// Set the command which will be executed | ||
| pub fn command(mut self, command: Command) -> Self { | ||
| self.command = Some(command); | ||
| self |
There was a problem hiding this comment.
This is set in new, why are we allowing it to be overridden?
Sorry, something went wrong.
| } | ||
|
|
||
| /// Set filtering out escape codes, such as colors. | ||
| pub fn strip_ansi_escape_codes(mut self) -> Self { |
There was a problem hiding this comment.
Let's accept a bool
Sorry, something went wrong.
| #[derive(Default)] | ||
| pub struct Builder { | ||
| /// A command to spawn | ||
| pub(super) command: Option<Command>, |
There was a problem hiding this comment.
Why allow an Option<Command> instead of a Command?
Sorry, something went wrong.
There was a problem hiding this comment.
Note: this needs a much bigger API re-work than to just add a builder because of the interactions within the different session types.
Sorry, something went wrong.
|
I've released rexpect 0.7 which should make it easier to evolve the API. The builder changes should not be needed anymore. For changing timeout_ms to a duration, I'd do it by adding a timeout method and deprecatingtimeout_ms. |
Sorry, something went wrong.
Thanks a lot, I will have a look and update my PR accordingly |
Sorry, something went wrong.
|
Comment from a lurker... @LightVillet in this PR is it possible to include a method for:
Doing this would make it easier to adjust timeouts based on how long you expect a command to run. For instance, an SSH CLI file transfer under Cisco IOS can take minutes (due to slow writes to flash memory), but most other Cisco IOS commands should return within one second. cc: @epage |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #142
Closes #144