From edb751dfed487cf787ed7405c512e457a41d35f8 Mon Sep 17 00:00:00 2001
From: Kare Morstol
Date: Wed, 5 Apr 2017 22:34:43 +0200
Subject: [PATCH] Update documentation.
---
Classes.html | 8 +-
Classes/AsyncCommand.html | 8 +-
Classes/FileHandleStream.html | 8 +-
Classes/MainContext.html | 8 +-
Classes/RunOutput.html | 111 +++++++++++++++++-
Classes/StdoutStream.html | 8 +-
Enums.html | 8 +-
Enums/CommandError.html | 8 +-
Enums/FileError.html | 8 +-
Extensions.html | 8 +-
Extensions/FileHandle.html | 8 +-
Extensions/LazyCollectionProtocol.html | 8 +-
Extensions/Process.html | 8 +-
Extensions/String.html | 39 +++++-
Functions.html | 64 ++++++----
Global Variables.html | 8 +-
Protocols.html | 8 +-
Protocols/CommandRunning.html | 64 ++++++----
Protocols/Context.html | 8 +-
Protocols/ReadableStream.html | 8 +-
Protocols/WritableStream.html | 8 +-
Structs.html | 8 +-
Structs/CustomContext.html | 13 +-
Structs/LazySplitSequence.html | 8 +-
Structs/PartialSourceLazySplitSequence.html | 8 +-
.../Contents/Resources/Documents/Classes.html | 8 +-
.../Documents/Classes/AsyncCommand.html | 8 +-
.../Documents/Classes/FileHandleStream.html | 8 +-
.../Documents/Classes/MainContext.html | 8 +-
.../Documents/Classes/RunOutput.html | 111 +++++++++++++++++-
.../Documents/Classes/StdoutStream.html | 8 +-
.../Contents/Resources/Documents/Enums.html | 8 +-
.../Documents/Enums/CommandError.html | 8 +-
.../Resources/Documents/Enums/FileError.html | 8 +-
.../Resources/Documents/Extensions.html | 8 +-
.../Documents/Extensions/FileHandle.html | 8 +-
.../Extensions/LazyCollectionProtocol.html | 8 +-
.../Documents/Extensions/Process.html | 8 +-
.../Documents/Extensions/String.html | 39 +++++-
.../Resources/Documents/Functions.html | 64 ++++++----
.../Resources/Documents/Global Variables.html | 8 +-
.../Resources/Documents/Protocols.html | 8 +-
.../Documents/Protocols/CommandRunning.html | 64 ++++++----
.../Documents/Protocols/Context.html | 8 +-
.../Documents/Protocols/ReadableStream.html | 8 +-
.../Documents/Protocols/WritableStream.html | 8 +-
.../Contents/Resources/Documents/Structs.html | 8 +-
.../Documents/Structs/CustomContext.html | 13 +-
.../Documents/Structs/LazySplitSequence.html | 8 +-
.../PartialSourceLazySplitSequence.html | 8 +-
.../Contents/Resources/Documents/index.html | 96 +++++++--------
.../Resources/Documents/undocumented.json | 25 ++--
.../Contents/Resources/docSet.dsidx | Bin 45056 -> 45056 bytes
docsets/SwiftShell.tgz | Bin 74303 -> 75089 bytes
index.html | 96 +++++++--------
undocumented.json | 25 ++--
56 files changed, 758 insertions(+), 386 deletions(-)
diff --git a/Classes.html b/Classes.html
index e24de0e..cb9e567 100644
--- a/Classes.html
+++ b/Classes.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -340,7 +340,7 @@
diff --git a/Classes/AsyncCommand.html b/Classes/AsyncCommand.html
index 20f8145..f3cdfc8 100644
--- a/Classes/AsyncCommand.html
+++ b/Classes/AsyncCommand.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -374,7 +374,7 @@
diff --git a/Classes/FileHandleStream.html b/Classes/FileHandleStream.html
index cca17b6..8dbbbd6 100644
--- a/Classes/FileHandleStream.html
+++ b/Classes/FileHandleStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -248,7 +248,7 @@
diff --git a/Classes/MainContext.html b/Classes/MainContext.html
index 9e62428..d855bf9 100644
--- a/Classes/MainContext.html
+++ b/Classes/MainContext.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -421,7 +421,7 @@ It lies in the user’s temporary directory and will be automatically delete
diff --git a/Classes/RunOutput.html b/Classes/RunOutput.html
index 7f24516..1a65c28 100644
--- a/Classes/RunOutput.html
+++ b/Classes/RunOutput.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -192,6 +192,33 @@
+ -
+
+
+
+
+
+
+
+
Declaration
+
+
Swift
+
public final class RunOutput
+
+
+
+
+
+
-
@@ -300,12 +327,88 @@
+ -
+
+
+
+
+
+
+
Run the first command, then the second one only if the first succeeded.
+
+
+
Returns
+ the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
+
Declaration
+
+
Swift
+
public static func && (lhs: RunOutput, rhs: @autoclosure () -> RunOutput) -> RunOutput
+
+
+
+
+
Return Value
+
the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
+ -
+
+
+
+
+
+
+
Run the first command, then the second one only if the first failed.
+
+
+
Returns
+ the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
+
Declaration
+
+
Swift
+
public static func || (lhs: RunOutput, rhs: @autoclosure () -> RunOutput) -> RunOutput
+
+
+
+
+
Return Value
+
the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
diff --git a/Classes/StdoutStream.html b/Classes/StdoutStream.html
index 5c062fd..4edf400 100644
--- a/Classes/StdoutStream.html
+++ b/Classes/StdoutStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -332,7 +332,7 @@
diff --git a/Enums.html b/Enums.html
index 7630bc0..decf7f9 100644
--- a/Enums.html
+++ b/Enums.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -257,7 +257,7 @@
diff --git a/Enums/CommandError.html b/Enums/CommandError.html
index 5d07a87..9f9e72d 100644
--- a/Enums/CommandError.html
+++ b/Enums/CommandError.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -285,7 +285,7 @@
diff --git a/Enums/FileError.html b/Enums/FileError.html
index a6390ad..654c381 100644
--- a/Enums/FileError.html
+++ b/Enums/FileError.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -286,7 +286,7 @@
diff --git a/Extensions.html b/Extensions.html
index 57923f3..a7bc2f5 100644
--- a/Extensions.html
+++ b/Extensions.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -323,7 +323,7 @@
diff --git a/Extensions/FileHandle.html b/Extensions/FileHandle.html
index 04e7fb6..cc05b1d 100644
--- a/Extensions/FileHandle.html
+++ b/Extensions/FileHandle.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -210,7 +210,7 @@
diff --git a/Extensions/LazyCollectionProtocol.html b/Extensions/LazyCollectionProtocol.html
index 1b77f64..2307737 100644
--- a/Extensions/LazyCollectionProtocol.html
+++ b/Extensions/LazyCollectionProtocol.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -268,7 +268,7 @@ a separator, should empty slices be emitted? Defaults to false.
diff --git a/Extensions/Process.html b/Extensions/Process.html
index 9351307..3c4aa1a 100644
--- a/Extensions/Process.html
+++ b/Extensions/Process.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -257,7 +257,7 @@
diff --git a/Extensions/String.html b/Extensions/String.html
index b06748c..6b27770 100644
--- a/Extensions/String.html
+++ b/Extensions/String.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -220,10 +220,41 @@
+
+
+ -
+
+
+
+
+
+
+
Split text into lines (as separated by newlines).
+
+
+
+
Declaration
+
+
Swift
+
public func lines() -> [String]
+
+
+
+
+
+
+
+
diff --git a/Functions.html b/Functions.html
index 70fe21e..6f533d1 100644
--- a/Functions.html
+++ b/Functions.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -195,9 +195,9 @@
@@ -212,7 +212,7 @@
Declaration
Swift
-
@discardableResult public func run (bash bashcommand: String, file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (bash bashcommand: String, combineOutput: Bool = false) -> RunOutput
@@ -233,6 +233,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -242,9 +255,9 @@
@@ -259,7 +272,7 @@
Declaration
Swift
-
public func runAsync (bash bashcommand: String) -> AsyncCommand
+
public func runAsync (bash bashcommand: String, file: String = #file, line: Int = #line) -> AsyncCommand
@@ -516,9 +529,9 @@
@@ -528,18 +541,12 @@
Runs a command.
-
-
Warning
- will crash if ‘executable’ could not be launched.
-
-
-
Declaration
Swift
-
@discardableResult public func run (_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (_ executable: String, _ args: Any ..., combineOutput: Bool = false) -> RunOutput
@@ -573,6 +580,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -935,7 +955,7 @@ If the file already exists and overwrite=false, the writing will begin at the en
diff --git a/Global Variables.html b/Global Variables.html
index d35f984..7a3f85d 100644
--- a/Global Variables.html
+++ b/Global Variables.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -240,7 +240,7 @@
diff --git a/Protocols.html b/Protocols.html
index 4557d49..bcc28aa 100644
--- a/Protocols.html
+++ b/Protocols.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -328,7 +328,7 @@
diff --git a/Protocols/CommandRunning.html b/Protocols/CommandRunning.html
index 8e233e5..edb19ab 100644
--- a/Protocols/CommandRunning.html
+++ b/Protocols/CommandRunning.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -234,9 +234,9 @@
-
-
- run(bash:file:line:)
+
+
+ run(bash:combineOutput:)
Extension method
@@ -254,7 +254,7 @@
Declaration
Swift
-
@discardableResult public func run (bash bashcommand: String, file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (bash bashcommand: String, combineOutput: Bool = false) -> RunOutput
@@ -275,6 +275,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -284,9 +297,9 @@
@@ -399,9 +412,9 @@
-
-
- run(_:_:file:line:)
+
+
+ run(_:_:combineOutput:)
Extension method
@@ -414,18 +427,12 @@
Runs a command.
-
-
Warning
- will crash if ‘executable’ could not be launched.
-
-
-
Declaration
Swift
-
@discardableResult public func run (_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (_ executable: String, _ args: Any ..., combineOutput: Bool = false) -> RunOutput
@@ -459,6 +466,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -623,7 +643,7 @@
diff --git a/Protocols/Context.html b/Protocols/Context.html
index 374ad0c..a76677f 100644
--- a/Protocols/Context.html
+++ b/Protocols/Context.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -331,7 +331,7 @@ separate process and changing the directory there will not affect the rest of th
diff --git a/Protocols/ReadableStream.html b/Protocols/ReadableStream.html
index c3c7889..c8a197c 100644
--- a/Protocols/ReadableStream.html
+++ b/Protocols/ReadableStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -492,7 +492,7 @@ the handler, it may be called once when stream is closed and empty.
diff --git a/Protocols/WritableStream.html b/Protocols/WritableStream.html
index 8505de0..f72a580 100644
--- a/Protocols/WritableStream.html
+++ b/Protocols/WritableStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -416,7 +416,7 @@ Works exactly the same way as print from Swift’s standard lib
diff --git a/Structs.html b/Structs.html
index 0475024..c6a726d 100644
--- a/Structs.html
+++ b/Structs.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -278,7 +278,7 @@
diff --git a/Structs/CustomContext.html b/Structs/CustomContext.html
index f8a63f1..d3e02c4 100644
--- a/Structs/CustomContext.html
+++ b/Structs/CustomContext.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -305,7 +305,8 @@ separate process and changing the directory there will not affect the rest of th
-
Creates a blank CustomContext.
+
Creates a blank CustomContext where env and stdin are empty, stdout and stderror discard everything and
+currentdirectory is the current working directory.
@@ -332,7 +333,7 @@ separate process and changing the directory there will not affect the rest of th
-
Creates a new CustomContext from another Context.
+
Creates an identical copy of another Context.
@@ -351,7 +352,7 @@ separate process and changing the directory there will not affect the rest of th
diff --git a/Structs/LazySplitSequence.html b/Structs/LazySplitSequence.html
index 83c96c0..3ad4dcb 100644
--- a/Structs/LazySplitSequence.html
+++ b/Structs/LazySplitSequence.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -405,7 +405,7 @@ a separator, should empty slices be emitted? Defaults to false.
diff --git a/Structs/PartialSourceLazySplitSequence.html b/Structs/PartialSourceLazySplitSequence.html
index ba80222..e155aae 100644
--- a/Structs/PartialSourceLazySplitSequence.html
+++ b/Structs/PartialSourceLazySplitSequence.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -298,7 +298,7 @@ or nil if there are no more collections.
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html
index e24de0e..cb9e567 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -340,7 +340,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/AsyncCommand.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/AsyncCommand.html
index 20f8145..f3cdfc8 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/AsyncCommand.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/AsyncCommand.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -374,7 +374,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/FileHandleStream.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/FileHandleStream.html
index cca17b6..8dbbbd6 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/FileHandleStream.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/FileHandleStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -248,7 +248,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/MainContext.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/MainContext.html
index 9e62428..d855bf9 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/MainContext.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/MainContext.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -421,7 +421,7 @@ It lies in the user’s temporary directory and will be automatically delete
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/RunOutput.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/RunOutput.html
index 7f24516..1a65c28 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/RunOutput.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/RunOutput.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -192,6 +192,33 @@
+ -
+
+
+
+
+
+
+
+
Declaration
+
+
Swift
+
public final class RunOutput
+
+
+
+
+
+
-
@@ -300,12 +327,88 @@
+ -
+
+
+
+
+
+
+
Run the first command, then the second one only if the first succeeded.
+
+
+
Returns
+ the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
+
Declaration
+
+
Swift
+
public static func && (lhs: RunOutput, rhs: @autoclosure () -> RunOutput) -> RunOutput
+
+
+
+
+
Return Value
+
the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
+ -
+
+
+
+
+
+
+
Run the first command, then the second one only if the first failed.
+
+
+
Returns
+ the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
+
Declaration
+
+
Swift
+
public static func || (lhs: RunOutput, rhs: @autoclosure () -> RunOutput) -> RunOutput
+
+
+
+
+
Return Value
+
the result of the second one if it was run, otherwise the first one.
+
+
+
+
+
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/StdoutStream.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/StdoutStream.html
index 5c062fd..4edf400 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/StdoutStream.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/StdoutStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -332,7 +332,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums.html
index 7630bc0..decf7f9 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -257,7 +257,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/CommandError.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/CommandError.html
index 5d07a87..9f9e72d 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/CommandError.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/CommandError.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -285,7 +285,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html
index a6390ad..654c381 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -286,7 +286,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html
index 57923f3..a7bc2f5 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -323,7 +323,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html
index 04e7fb6..cc05b1d 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -210,7 +210,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html
index 1b77f64..2307737 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -268,7 +268,7 @@ a separator, should empty slices be emitted? Defaults to false.
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/Process.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/Process.html
index 9351307..3c4aa1a 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/Process.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/Process.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -257,7 +257,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html
index b06748c..6b27770 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -220,10 +220,41 @@
+
+
+ -
+
+
+
+
+
+
+
Split text into lines (as separated by newlines).
+
+
+
+
Declaration
+
+
Swift
+
public func lines() -> [String]
+
+
+
+
+
+
+
+
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html
index 70fe21e..6f533d1 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -195,9 +195,9 @@
@@ -212,7 +212,7 @@
Declaration
Swift
-
@discardableResult public func run (bash bashcommand: String, file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (bash bashcommand: String, combineOutput: Bool = false) -> RunOutput
@@ -233,6 +233,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -242,9 +255,9 @@
@@ -259,7 +272,7 @@
Declaration
Swift
-
public func runAsync (bash bashcommand: String) -> AsyncCommand
+
public func runAsync (bash bashcommand: String, file: String = #file, line: Int = #line) -> AsyncCommand
@@ -516,9 +529,9 @@
@@ -528,18 +541,12 @@
Runs a command.
-
-
Warning
- will crash if ‘executable’ could not be launched.
-
-
-
Declaration
Swift
-
@discardableResult public func run (_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (_ executable: String, _ args: Any ..., combineOutput: Bool = false) -> RunOutput
@@ -573,6 +580,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -935,7 +955,7 @@ If the file already exists and overwrite=false, the writing will begin at the en
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Global Variables.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Global Variables.html
index d35f984..7a3f85d 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Global Variables.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Global Variables.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -240,7 +240,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html
index 4557d49..bcc28aa 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -328,7 +328,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html
index 8e233e5..edb19ab 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -234,9 +234,9 @@
-
-
- run(bash:file:line:)
+
+
+ run(bash:combineOutput:)
Extension method
@@ -254,7 +254,7 @@
Declaration
Swift
-
@discardableResult public func run (bash bashcommand: String, file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (bash bashcommand: String, combineOutput: Bool = false) -> RunOutput
@@ -275,6 +275,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -284,9 +297,9 @@
@@ -399,9 +412,9 @@
-
-
- run(_:_:file:line:)
+
+
+ run(_:_:combineOutput:)
Extension method
@@ -414,18 +427,12 @@
Runs a command.
-
-
Warning
- will crash if ‘executable’ could not be launched.
-
-
-
Declaration
Swift
-
@discardableResult public func run (_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> RunOutput
+
@discardableResult public func run (_ executable: String, _ args: Any ..., combineOutput: Bool = false) -> RunOutput
@@ -459,6 +466,19 @@
+
+
+
+ combineOutput
+
+ |
+
+
+ if true then stdout and stderror go to the same stream. Default is false.
+
+
+ |
+
@@ -623,7 +643,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html
index 374ad0c..a76677f 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -331,7 +331,7 @@ separate process and changing the directory there will not affect the rest of th
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/ReadableStream.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/ReadableStream.html
index c3c7889..c8a197c 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/ReadableStream.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/ReadableStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -492,7 +492,7 @@ the handler, it may be called once when stream is closed and empty.
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/WritableStream.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/WritableStream.html
index 8505de0..f72a580 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/WritableStream.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/WritableStream.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -416,7 +416,7 @@ Works exactly the same way as print from Swift’s standard lib
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs.html
index 0475024..c6a726d 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -278,7 +278,7 @@
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html
index f8a63f1..d3e02c4 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -305,7 +305,8 @@ separate process and changing the directory there will not affect the rest of th
-
Creates a blank CustomContext.
+
Creates a blank CustomContext where env and stdin are empty, stdout and stderror discard everything and
+currentdirectory is the current working directory.
@@ -332,7 +333,7 @@ separate process and changing the directory there will not affect the rest of th
-
Creates a new CustomContext from another Context.
+
Creates an identical copy of another Context.
@@ -351,7 +352,7 @@ separate process and changing the directory there will not affect the rest of th
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html
index 83c96c0..3ad4dcb 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -405,7 +405,7 @@ a separator, should empty slices be emitted? Defaults to false.
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/PartialSourceLazySplitSequence.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/PartialSourceLazySplitSequence.html
index ba80222..e155aae 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/PartialSourceLazySplitSequence.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/PartialSourceLazySplitSequence.html
@@ -118,10 +118,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -133,7 +133,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -298,7 +298,7 @@ or nil if there are no more collections.
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/index.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/index.html
index b199d8e..4d126f6 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/index.html
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/index.html
@@ -117,10 +117,10 @@
open(forWriting:overwrite:encoding:)
- run(_:_:file:line:)
+ run(_:_:combineOutput:)
- run(bash:file:line:)
+ run(bash:combineOutput:)
runAndPrint(_:_:)
@@ -132,7 +132,7 @@
runAsync(_:_:file:line:)
- runAsync(bash:)
+ runAsync(bash:file:line:)
streams()
@@ -185,6 +185,10 @@
Swift 3 | Swift 2
+
+
+
+

SwiftShell
@@ -207,6 +211,7 @@
Example scripts
@@ -235,34 +240,55 @@
Overview
Context
-
All applications (processes) have access to some information about the outside world and ways of communicating with it. This is represented in SwiftShell by the Context protocol:
-
public protocol Context {
- var env: [String: String] {get set}
- var currentdirectory: String {get set}
- var stdin: ReadableStream {get set}
- var stdout: WritableStream {get set}
- var stderror: WritableStream {get set}
+All commands (a.k.a. processes) you run in SwiftShell need context: environment variables, the current working directory, standard input, standard output and standard error (see standard streams).
+public struct CustomContext: Context, CommandRunning {
+ public var env: [String: String]
+ public var currentdirectory: String
+ public var stdin: ReadableStream
+ public var stdout: WritableStream
+ public var stderror: WritableStream
}
-
-You can list them in the terminal with the env command.
-
-
-Used as the base for all relative paths. Most commands expect this to be the directory they are supposed to do stuff in.
-
-Commands don’t change their context.
+You can create a copy of your application’s context: let context = CustomContext(main), or create a new empty one: let context = CustomContext().
Main context
-So what else can main do? It is the only global value in SwiftShell and contains all the contextual information about the outside world:
-var encoding: UInt
-lazy var tempdirectory: String
+The global variable main contains the context for the application itself. In addition to the properties mentioned above it also has these:
-lazy var arguments: [String]
-lazy var name: String
+
+public var encoding: String.Encoding
+The default encoding used when opening files or creating new streams.
+public let tempdirectory: String
+A temporary directory the application can use for temporary stuff.
+public let arguments: [String]
+The arguments used when launching the application.
+public let path: String
+The path to the application.
+
+
+Everything is mutable, so you can set e.g. the text encoding or reroute standard error to a file. But commands can’t change the context they run in (or anything else in your application) so e.g. main.run("cd", "somefolder") will achieve nothing. Use main.currentdirectory = "somefolder" instead.
+Streams
+Output
+
+main.stdout is for normal output and main.stderror for errors. You can also write to a file:
+main.stdout.print("everything is fine")
+main.stderror.print("no wait, something went wrong ...")
+
+let file = try open(forWriting: path)
+file.print("something")
-Everything is mutable, so you can set e.g. the text encoding or reroute standard error to a file.
+.write doesn’t add a newline, and you can change the text encoding with .encoding.
+
+
+Use main.stdin to read from standard input, or you can read from a file:
+let input: String? = main.stdin.readSome() // read what is available, don't wait for end of file
+
+let file = try open(path)
+let contents: String = file.read() // read everything
+
+
+Using .readSome() you can read piecewise instead of waiting for the input to be finished and then reading everything at once. You can change the text encoding with .encoding.
Commands
Run
let date: String = run("date", "-u")
@@ -337,28 +363,6 @@
When launched from the top level you don’t need to catch any errors, but you still have to use try.
-Streams
-Output
-
-main.stdout is for normal output and main.stderror for errors. You can also write to a file:
-main.stdout.print("everything is fine")
-main.stderror.print("no wait, something went wrong ...")
-
-let file = try open(forWriting: path)
-file.print("something")
-
-
-.write doesn’t add a newline, and you can change the text encoding with .encoding.
-
-
-Use main.stdin to read from standard input, or you can read from a file:
-let input: String? = main.stdin.readSome() // read what is available, don't wait for end of file
-
-let file = try open(path)
-let contents: String = file.read() // read everything
-
-
-Using .readSome() you can read piecewise instead of waiting for the input to be finished and then reading everything at once. You can change the text encoding with .encoding.
The Terminal
Setup
@@ -418,7 +422,7 @@ cd SwiftShell
diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/undocumented.json b/docsets/SwiftShell.docset/Contents/Resources/Documents/undocumented.json
index 4428491..9d097a9 100644
--- a/docsets/SwiftShell.docset/Contents/Resources/Documents/undocumented.json
+++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/undocumented.json
@@ -23,21 +23,28 @@
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Command.swift",
- "line": 240,
+ "line": 174,
+ "symbol": "RunOutput.error",
+ "symbol_kind": "source.lang.swift.decl.var.instance",
+ "warning": "undocumented"
+ },
+ {
+ "file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Command.swift",
+ "line": 251,
"symbol": "AsyncCommand.stdout",
"symbol_kind": "source.lang.swift.decl.var.instance",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Command.swift",
- "line": 241,
+ "line": 252,
"symbol": "AsyncCommand.stderror",
"symbol_kind": "source.lang.swift.decl.var.instance",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Command.swift",
- "line": 286,
+ "line": 306,
"symbol": "AsyncCommand.onCompletion(handler:)",
"symbol_kind": "source.lang.swift.decl.function.method.instance",
"warning": "undocumented"
@@ -121,42 +128,42 @@
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Context.swift",
- "line": 92,
+ "line": 93,
"symbol": "MainContext",
"symbol_kind": "source.lang.swift.decl.class",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Context.swift",
- "line": 100,
+ "line": 101,
"symbol": "MainContext.env",
"symbol_kind": "source.lang.swift.decl.var.instance",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Context.swift",
- "line": 101,
+ "line": 102,
"symbol": "MainContext.stdin",
"symbol_kind": "source.lang.swift.decl.var.instance",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Context.swift",
- "line": 102,
+ "line": 103,
"symbol": "MainContext.stdout",
"symbol_kind": "source.lang.swift.decl.var.instance",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Context.swift",
- "line": 103,
+ "line": 104,
"symbol": "MainContext.stderror",
"symbol_kind": "source.lang.swift.decl.var.instance",
"warning": "undocumented"
},
{
"file": "/Users/karemorstol/Programming/SwiftShell/SwiftShell3/Sources/SwiftShell/Context.swift",
- "line": 138,
+ "line": 139,
"symbol": "main",
"symbol_kind": "source.lang.swift.decl.var.global",
"warning": "undocumented"
diff --git a/docsets/SwiftShell.docset/Contents/Resources/docSet.dsidx b/docsets/SwiftShell.docset/Contents/Resources/docSet.dsidx
index 6f6bfab7c2ea59698c05a50a3eaf33a17fbe00ef..186dc7f7be8bf8b4ad5c6f84fb38fba965264bc2 100644
GIT binary patch
delta 3137
zcmai03vg7`89x8rz31-U-Fr6y7r04o)({{h5kg*)kc1FJHiVD|Y=}TMY&H)duifk`
zAt7vXLyUlo82M6f8J${n9H*_;(zBcB6bbdt
z?A>$zbMAls^Plhk&Nq668@(aMYiHYyGOy&Bi1xlWtYD{orLCUL!P1)oSqliZWcgtB@~d
zMm^SNryN_hZA2vJNDlE6%OjS0`78N?{FFQt4W
z+=tv=j%Q1;Cz-dAbj}{~v;{l8i#&nZmM5@sPq4R#jN14Vk_q_Al){e?0tx6XZ-!PD
z@3UnId?H!OIfDLBTQD&DH}loljMsX7>wl_FdxvCpn>>d4uM6i-u$$7#h!SmqK+jW1{4RarH_mlIM!1Fy%-NK3cYu
z_vp`%jW{%B$GGwrW2ZWZ_Vo=Az#pwYh9zZt1UFr%YH5J)PnRa;cliBYf2G4$=Wu1`
zlzV%7-JbS}sLj=fr|;OMXZR5D+RE`rtNj7MZR-wz7ynt=Oe+fbMAd=+sl3hL3H9`>
z@91BTM>n{kF7nxiYJfY@wq#=dCO%Oafu2rJM_~Ck*@HC
zA8D9o@~8R5dM_)Xt(*>?1UD=v7bbmSgR_E?M20rJR@o@5UeB|RgS9ggXSZ8j&P>Y4
zoSTckVRMl$-H-CBuYi&wRa@#0d18oZ^Y*r~
zx*3kv$k)4n0daeCDJfO8EH<|+Fz9K+l&%6SJvt8y?wW^>Psqu>97;-5Ej7AMt2?k~
z&2?^~3t{G6Qv8kXgI&d(IxmAosc7AENBQ=|Mtpgk;!AfKZghZIz4us^Jyo#f6tQ^ak7Sqhg)}YoNySo}`89K^
znVL?SlEnMPJdqkN8z+r-7=CNmEIcbz(D*n#})--=hCie^|d*cV1V`eZWm{d2j)o
zz>`yxzIv{y7mIvO=)s44jnIvs_*oWv6Yhfs+QT|>BqPIrFb!_mB>Nob~o0XrWj>k_b}ZWHHo;vWVA(1e@zJ}B&n`EbO1%yK9f+>Wln5F@mA2Ww4t
zQess!U9Y>-gI5M`!yQ8lpb>pTX^g%e9$FzZP?D-@3YHBkXv