File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,7 +179,9 @@ void main() async {
179179}
180180```
181181
182- > ` client.run() ` is a convenience method that wraps ` client.execute() ` for running non-interactive commands.
182+ > ` client.run() ` is a convenience method that returns combined output bytes.
183+ > Use ` client.runWithResult() ` when you need separate ` stdout ` / ` stderr `
184+ > streams and command exit metadata (` exitCode ` / ` exitSignal ` ).
183185
184186To also access command exit metadata:
185187
@@ -188,6 +190,7 @@ void main() async {
188190 final result = await client.runWithResult('echo hello');
189191 print('exitCode: ${result.exitCode}');
190192 print('stdout: ${utf8.decode(result.stdout)}');
193+ print('stderr: ${utf8.decode(result.stderr)}');
191194}
192195```
193196
Original file line number Diff line number Diff line change @@ -564,6 +564,9 @@ class SSHClient {
564564 /// This is a convenience method over [execute] . If [stdout] is false,
565565 /// the standard output of the command will be ignored. If [stderr] is
566566 /// false, the standard error of the command will be ignored.
567+ ///
568+ /// Use [runWithResult] when you need separate stdout/stderr bytes or exit
569+ /// metadata (`exitCode` /`exitSignal` ).
567570 Future <Uint8List > run (
568571 String command, {
569572 bool runInPty = false ,
You can’t perform that action at this time.
0 commit comments