From 4b25e7d10b88dbe57c8a62e5ecfd500e4ae06a4f Mon Sep 17 00:00:00 2001 From: Kare Morstol Date: Wed, 18 Apr 2018 00:56:44 +0200 Subject: [PATCH] Update documentation. --- Classes.html | 59 +- Classes/AsyncCommand.html | 167 +----- Classes/FileHandleStream.html | 37 +- Classes/MainContext.html | 76 +-- Classes/PrintedAsyncCommand.html | 518 ++++++++++++++++++ Classes/RunOutput.html | 53 +- Classes/StdoutStream.html | 41 +- Enums.html | 31 +- Enums/CommandError.html | 69 ++- Enums/FileError.html | 33 +- Extensions.html | 63 ++- Extensions/FileHandle.html | 29 +- Extensions/LazyCollectionProtocol.html | 37 +- Extensions/Process.html | 105 ++-- Extensions/String.html | 37 +- Functions.html | 232 +++++--- Global Variables.html | 37 +- Protocols.html | 29 +- Protocols/CommandRunning.html | 172 +++++- Protocols/Context.html | 53 +- Protocols/ReadableStream.html | 60 +- Protocols/WritableStream.html | 41 +- Structs.html | 34 +- Structs/CustomContext.html | 49 +- Structs/LazySplitSequence.html | 48 +- Structs/PartialSourceLazySplitSequence.html | 33 +- badge.svg | 4 +- .../Contents/Resources/Documents/Classes.html | 59 +- .../Documents/Classes/AsyncCommand.html | 167 +----- .../Documents/Classes/FileHandleStream.html | 37 +- .../Documents/Classes/MainContext.html | 76 +-- .../Classes/PrintedAsyncCommand.html | 518 ++++++++++++++++++ .../Documents/Classes/RunOutput.html | 53 +- .../Documents/Classes/StdoutStream.html | 41 +- .../Contents/Resources/Documents/Enums.html | 31 +- .../Documents/Enums/CommandError.html | 69 ++- .../Resources/Documents/Enums/FileError.html | 33 +- .../Resources/Documents/Extensions.html | 63 ++- .../Documents/Extensions/FileHandle.html | 29 +- .../Extensions/LazyCollectionProtocol.html | 37 +- .../Documents/Extensions/Process.html | 105 ++-- .../Documents/Extensions/String.html | 37 +- .../Resources/Documents/Functions.html | 232 +++++--- .../Resources/Documents/Global Variables.html | 37 +- .../Resources/Documents/Protocols.html | 29 +- .../Documents/Protocols/CommandRunning.html | 172 +++++- .../Documents/Protocols/Context.html | 53 +- .../Documents/Protocols/ReadableStream.html | 60 +- .../Documents/Protocols/WritableStream.html | 41 +- .../Contents/Resources/Documents/Structs.html | 34 +- .../Documents/Structs/CustomContext.html | 49 +- .../Documents/Structs/LazySplitSequence.html | 48 +- .../PartialSourceLazySplitSequence.html | 33 +- .../Contents/Resources/Documents/index.html | 85 +-- .../Contents/Resources/Documents/search.json | 2 +- .../Contents/Resources/docSet.dsidx | Bin 45056 -> 45056 bytes docsets/SwiftShell.tgz | Bin 82844 -> 86580 bytes index.html | 85 +-- search.json | 2 +- undocumented.json | 35 +- 60 files changed, 3158 insertions(+), 1341 deletions(-) create mode 100644 Classes/PrintedAsyncCommand.html create mode 100644 docsets/SwiftShell.docset/Contents/Resources/Documents/Classes/PrintedAsyncCommand.html diff --git a/Classes.html b/Classes.html index c06dcd4..ed22bcd 100644 --- a/Classes.html +++ b/Classes.html @@ -13,7 +13,7 @@
-

SwiftShell Docs (70% documented)

+

SwiftShell Docs (73% documented)

View on GitHub

@@ -39,6 +39,9 @@ + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -231,6 +240,34 @@ +
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static public func == (e1: CommandError, e2: CommandError) -> Bool
    + +
    +
    +
    +
    +
  • +
+
diff --git a/Enums/FileError.html b/Enums/FileError.html index 8b3dcf3..3140830 100644 --- a/Enums/FileError.html +++ b/Enums/FileError.html @@ -14,7 +14,7 @@
-

SwiftShell Docs (70% documented)

+

SwiftShell Docs (73% documented)

View on GitHub

@@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -257,9 +266,9 @@
  • - + - description + description
    @@ -285,7 +294,7 @@ diff --git a/Extensions.html b/Extensions.html index f3b42a6..2ce024a 100644 --- a/Extensions.html +++ b/Extensions.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -213,6 +222,36 @@ +
    + + +
    • @@ -270,7 +309,7 @@
      -

      Let Strings run commands using itself as stdin.

      +

      Lets String run commands using itself as stdin.

      See more
      @@ -309,7 +348,7 @@

      Declaration

      Swift

      -
      protocol LazyCollectionProtocol : Collection, LazySequenceProtocol
      +
      protocol LazyCollectionProtocol : Collection, LazySequenceProtocol where Self.Elements : Collection
    @@ -321,7 +360,7 @@ diff --git a/Extensions/FileHandle.html b/Extensions/FileHandle.html index 2d732ca..345c56a 100644 --- a/Extensions/FileHandle.html +++ b/Extensions/FileHandle.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -209,7 +218,7 @@ diff --git a/Extensions/LazyCollectionProtocol.html b/Extensions/LazyCollectionProtocol.html index ab27631..6b784be 100644 --- a/Extensions/LazyCollectionProtocol.html +++ b/Extensions/LazyCollectionProtocol.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -182,7 +191,7 @@

    LazyCollectionProtocol

    -
    protocol LazyCollectionProtocol : Collection, LazySequenceProtocol
    +
    protocol LazyCollectionProtocol : Collection, LazySequenceProtocol where Self.Elements : Collection
    @@ -194,9 +203,9 @@
  • - + - split(separator:allowEmptySlices:) + split(separator:allowEmptySlices:)
    @@ -212,7 +221,7 @@

    Swift

    public func split(
    -	separator: Elements.Iterator.Element, allowEmptySlices: Bool = false
    +	separator: Elements.Element, allowEmptySlices: Bool = false
     	) -> LazySplitSequence<Elements>
    @@ -257,7 +266,7 @@ a separator, should empty slices be emitted? Defaults to false.

    diff --git a/Extensions/Process.html b/Extensions/Process.html index 6144ed1..6ad766d 100644 --- a/Extensions/Process.html +++ b/Extensions/Process.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -188,9 +197,9 @@
  • - - - launchThrowably() + + + terminate()
    @@ -198,21 +207,8 @@
    -

    Launch process.

    -
    -

    Throws

    - CommandError.inAccessibleExecutable if command could not be executed. +

    Terminates the command by sending the SIGTERM signal

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func launchThrowably() throws
    - -
    @@ -220,9 +216,9 @@
  • - - - finish() + + + interrupt()
    @@ -230,21 +226,46 @@
    -

    Wait until process is finished.

    -
    -

    Throws

    - CommandError.returnedErrorCode(command: String, errorcode: Int) if the exit code is anything but 0. - -
    +

    Interrupts the command by sending the SIGINT signal

    -
    -

    Declaration

    -
    -

    Swift

    -
    public func finish() throws
    +
    +
    +
  • +
  • +
    + + + + suspend() + +
    +
    +
    +
    +
    +
    +

    Temporarily suspends a command. Call resume() to resume a suspended command

    + +
    +
    +
    +
  • +
  • +
    + + + + resume() + +
    +
    +
    +
    +
    +
    +

    Resumes a command previously suspended with suspend().

    -
    @@ -254,7 +275,7 @@ diff --git a/Extensions/String.html b/Extensions/String.html index b3a0c4e..4079538 100644 --- a/Extensions/String.html +++ b/Extensions/String.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -186,7 +195,7 @@ -

    Let Strings run commands using itself as stdin.

    +

    Lets String run commands using itself as stdin.

    @@ -195,9 +204,9 @@
  • - + - context + context
    @@ -236,7 +245,7 @@
    -

    Split text into lines (as separated by newlines).

    +

    Splits text into lines (as separated by newlines).

    @@ -255,7 +264,7 @@
  • diff --git a/Functions.html b/Functions.html index 7c73845..cfaafd4 100644 --- a/Functions.html +++ b/Functions.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@ + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -263,7 +272,7 @@
    -

    Run bash command and return before it is finished.

    +

    Runs bash command and returns before it is finished.

    @@ -293,9 +302,52 @@
    +
    + + +
  • +
    + + + + runAsyncAndPrint(bash:file:line:) + +
    +
    +
    +
    +
    +
    +

    Runs bash command and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(bash bashcommand: String, file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    -

    Return Value

    -

    an AsyncCommand struct with standard output, standard error and a ‘finish’ function.

    +

    Parameters

    + + + + + + + +
    + + bashcommand + + +
    +

    the bash shell command.

    +
    +
    @@ -313,7 +365,7 @@
    -

    Run bash command and print output and errors.

    +

    Runs bash command and prints output and errors.

    Throws

    a CommandError.returnedErrorCode if the return code is anything but 0. @@ -375,7 +427,7 @@
    -

    Print message to standard error and halt execution.

    +

    Prints message to standard error and terminates the application.

    @@ -437,7 +489,7 @@
    -

    Print error to standard error and halt execution.

    +

    Prints error to standard error and terminates the application.

    @@ -476,44 +528,6 @@
  • -
    - - -
    @@ -526,9 +540,9 @@
  • @@ -596,9 +610,9 @@
  • @@ -606,10 +620,10 @@
    -

    Run executable and return before it is finished.

    +

    Runs executable and returns before it is finished.

    Warning

    - will crash if ‘executable’ could not be launched. + Application will be terminated if ‘executable’ could not be launched.
    @@ -634,7 +648,7 @@
    -

    path to an executable file.

    +

    Path to an executable file. If not then exit.

    @@ -646,26 +660,22 @@
    -

    arguments to the executable.

    +

    Arguments to the executable.

    -
    -

    Return Value

    -

    an AsyncCommand with standard output, standard error and a ‘finish’ function.

    -
  • @@ -673,7 +683,71 @@
    -

    Run executable and print output and errors.

    +

    Runs executable and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    +
    +

    Warning

    + Application will be terminated if ‘executable’ could not be launched. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + executable + + +
    +

    Path to an executable file. If not then exit.

    +
    +
    + + args + + +
    +

    Arguments to the executable.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runAndPrint(_:_:) + +
    +
    +
    +
    +
    +
    +

    Runs executable and prints output and errors.

    Throws

    CommandError.returnedErrorCode(command: String, errorcode: Int) if the exit code is anything but 0.

    @@ -742,7 +816,7 @@
    -

    Append file or directory url to directory url

    +

    Appends file or directory url to directory url

    @@ -769,14 +843,14 @@
    -

    Open a file for reading, throw if an error occurs.

    +

    Opens a file for reading, throws if an error occurs.

    Declaration

    Swift

    -
    public func open(_ path: String, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    +
    public func open(_ path: String, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    @@ -796,14 +870,14 @@
    -

    Open a file for reading, throw if an error occurs.

    +

    Opens a file for reading, throws if an error occurs.

    Declaration

    Swift

    -
    public func open(_ path: URL, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    +
    public func open(_ path: URL, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    @@ -823,7 +897,7 @@
    -

    Open a file for writing, create it first if it doesn’t exist. +

    Opens a file for writing, creates it first if it doesn’t exist. If the file already exists and overwrite=false, the writing will begin at the end of the file.

    @@ -831,7 +905,7 @@ If the file already exists and overwrite=false, the writing will begin at the en

    Declaration

    Swift

    -
    public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    +
    public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    @@ -870,7 +944,7 @@ If the file already exists and overwrite=false, the writing will begin at the en
    -

    Open a file for writing, create it first if it doesn’t exist. +

    Opens a file for writing, creates it first if it doesn’t exist. If the file already exists and overwrite=false, the writing will begin at the end of the file.

    @@ -878,7 +952,7 @@ If the file already exists and overwrite=false, the writing will begin at the en

    Declaration

    Swift

    -
    public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    +
    public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    @@ -940,7 +1014,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 a63713a..3b668ee 100644 --- a/Global Variables.html +++ b/Global Variables.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -188,9 +197,9 @@
  • - + - main + main
    @@ -219,9 +228,9 @@
  • - + - Files + Files
    @@ -248,7 +257,7 @@ diff --git a/Protocols.html b/Protocols.html index 796a07f..61ae3e6 100644 --- a/Protocols.html +++ b/Protocols.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -336,7 +345,7 @@ diff --git a/Protocols/CommandRunning.html b/Protocols/CommandRunning.html index 2020ed6..a4d256f 100644 --- a/Protocols/CommandRunning.html +++ b/Protocols/CommandRunning.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - context + context Default implementation @@ -308,7 +317,7 @@
    -

    Run bash command and return before it is finished.

    +

    Runs bash command and returns before it is finished.

    @@ -338,9 +347,55 @@
    +
    +
    +
  • +
  • +
    + + + + runAsyncAndPrint(bash:file:line:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Runs bash command and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(bash bashcommand: String, file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    -

    Return Value

    -

    an AsyncCommand struct with standard output, standard error and a ‘finish’ function.

    +

    Parameters

    + + + + + + + +
    + + bashcommand + + +
    +

    the bash shell command.

    +
    +
    @@ -361,7 +416,7 @@
    -

    Run bash command and print output and errors.

    +

    Runs bash command and prints output and errors.

    Throws

    a CommandError.returnedErrorCode if the return code is anything but 0. @@ -406,9 +461,9 @@
  • - + - run(_:_:combineOutput:) + run(_:_:combineOutput:) Extension method @@ -483,9 +538,9 @@
  • - + - runAsync(_:_:file:line:) + runAsync(_:_:file:line:) Extension method @@ -496,10 +551,10 @@
    -

    Run executable and return before it is finished.

    +

    Runs executable and returns before it is finished.

    Warning

    - Will crash if ‘executable’ could not be launched. + Application will be terminated if ‘executable’ could not be launched.
    @@ -543,9 +598,72 @@
    +
    +
    +
  • +
  • +
    + + + + runAsyncAndPrint(_:_:file:line:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Runs executable and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    +
    +

    Warning

    + Application will be terminated if ‘executable’ could not be launched. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    -

    Return Value

    -

    An AsyncCommand with standard output, standard error and a ‘finish’ function.

    +

    Parameters

    + + + + + + + + + + + +
    + + executable + + +
    +

    Path to an executable file. If not then exit.

    +
    +
    + + args + + +
    +

    Arguments to the executable.

    +
    +
    @@ -557,9 +675,9 @@
  • - + - runAndPrint(_:_:) + runAndPrint(_:_:) Extension method @@ -570,7 +688,7 @@
    -

    Run executable and print output and errors.

    +

    Runs executable and prints output and errors.

    Throws

    CommandError.returnedErrorCode(command: String, errorcode: Int) if the exit code is anything but 0.

    @@ -627,7 +745,7 @@
  • diff --git a/Protocols/Context.html b/Protocols/Context.html index e650922..0645bce 100644 --- a/Protocols/Context.html +++ b/Protocols/Context.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - env + env
    @@ -222,9 +231,9 @@
  • - + - stdin + stdin
    @@ -249,9 +258,9 @@
  • - + - stdout + stdout
    @@ -276,9 +285,9 @@
  • - + - stderror + stderror
    @@ -303,9 +312,9 @@
  • @@ -337,9 +346,9 @@ separate process and changing the directory there will not affect the rest of th
  • - + - debugDescription + debugDescription Extension method @@ -369,7 +378,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 6013db9..23136bd 100644 --- a/Protocols/ReadableStream.html +++ b/Protocols/ReadableStream.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - encoding + encoding
    @@ -222,9 +231,9 @@
  • @@ -417,9 +426,9 @@ If the stream is empty and still open this will wait for more content or end-of-
  • - + - context + context Extension method @@ -496,14 +505,17 @@ If the stream is empty and still open this will wait for more content or end-of-
    -

    Reads everything at once.

    +

    Reads everything at once. +Marked with @discardableResult so that the stream can be read before +calling .finish() without causing any compiler warnings or requiring +developer work-arounds when the result will not be used (see #52 & #57)

    Declaration

    Swift

    -
    public func readData() -> Data
    +
    @discardableResult public func readData() -> Data
    @@ -530,11 +542,11 @@ If the stream is empty and still open this will wait for more content or end-of-
    -

    handler will be called whenever there is new output available.

    +

    Sets code to be executed whenever there is new output available.

    Note

    - if the stream is read from outside of the handler, or more than once inside -the handler, it may be called once when stream is closed and empty. + if the stream is read from outside of handler, or more than once inside +it, it may be called once when stream is closed and empty.
    @@ -566,11 +578,11 @@ the handler, it may be called once when stream is closed and empty.
    -

    handler will be called whenever there is new text output available.

    +

    Sets code to be executed whenever there is new text output available.

    Note

    - if the stream is read from outside of the handler, or more than once inside -the handler, it may be called once when stream is closed and empty. + if the stream is read from outside of handler, or more than once inside +it, it may be called once when stream is closed and empty.
    @@ -591,7 +603,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 00fdc76..6e8e8eb 100644 --- a/Protocols/WritableStream.html +++ b/Protocols/WritableStream.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables
  • @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - encoding + encoding
    @@ -222,9 +231,9 @@
  • @@ -323,9 +332,9 @@ to prevent deadlock when reading.

  • - + - print(_:separator:terminator:) + print(_:separator:terminator:) Extension method @@ -431,7 +440,7 @@ Works exactly the same way as print from Swift’s standard lib diff --git a/Structs.html b/Structs.html index 28b4570..1833c91 100644 --- a/Structs.html +++ b/Structs.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -239,8 +248,7 @@

    Swift

    public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    -	Base.SubSequence: Collection
    + Base.Element: Equatable
    @@ -269,7 +277,7 @@

    Swift

    public struct PartialSourceLazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    +	Base.Element: Equatable,
     	Base.SubSequence: RangeReplaceableCollection
    @@ -282,7 +290,7 @@ diff --git a/Structs/CustomContext.html b/Structs/CustomContext.html index b1353bc..b9b6e08 100644 --- a/Structs/CustomContext.html +++ b/Structs/CustomContext.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - env + env
    @@ -222,9 +231,9 @@
  • - + - stdin + stdin
    @@ -249,9 +258,9 @@
  • - + - stdout + stdout
    @@ -276,9 +285,9 @@
  • - + - stderror + stderror
    @@ -303,9 +312,9 @@
  • - + - currentdirectory + currentdirectory
    @@ -390,7 +399,7 @@ currentdirectory is the current working directory.

    diff --git a/Structs/LazySplitSequence.html b/Structs/LazySplitSequence.html index 2e257f9..a9df93c 100644 --- a/Structs/LazySplitSequence.html +++ b/Structs/LazySplitSequence.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -183,8 +192,7 @@
    public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    -	Base.SubSequence: Collection
    + Base.Element: Equatable
    @@ -197,9 +205,9 @@
  • - + - remaining + remaining
    @@ -224,9 +232,9 @@
  • - + - separator + separator
    @@ -241,7 +249,7 @@

    Declaration

    Swift

    -
    public let separator: Base.Iterator.Element
    +
    public let separator: Base.Element
    @@ -251,9 +259,9 @@
  • - + - allowEmptySlices + allowEmptySlices
    @@ -295,7 +303,7 @@

    Declaration

    Swift

    -
    public init(_ base: Base, separator: Base.Iterator.Element, allowEmptySlices: Bool = false)
    +
    public init(_ base: Base, separator: Base.Element, allowEmptySlices: Bool = false)
    @@ -378,7 +386,7 @@ a separator, should empty slices be emitted? Defaults to false.

    diff --git a/Structs/PartialSourceLazySplitSequence.html b/Structs/PartialSourceLazySplitSequence.html index be9e0b0..f039b82 100644 --- a/Structs/PartialSourceLazySplitSequence.html +++ b/Structs/PartialSourceLazySplitSequence.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -183,7 +192,7 @@
    public struct PartialSourceLazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    +	Base.Element: Equatable,
     	Base.SubSequence: RangeReplaceableCollection
    @@ -214,7 +223,7 @@

    Declaration

    Swift

    -
    public init(_ bases: @escaping () -> Base?, separator: Base.Iterator.Element)
    +
    public init(_ bases: @escaping () -> Base?, separator: Base.Element)
    @@ -285,7 +294,7 @@ or nil if there are no more collections.

    diff --git a/badge.svg b/badge.svg index 68d980a..70c4b64 100644 --- a/badge.svg +++ b/badge.svg @@ -19,10 +19,10 @@ documentation - 70% + 73% - 70% + 73% diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html index c06dcd4..ed22bcd 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Classes.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@ + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -231,6 +240,34 @@
    +
    +
      +
    • +
      + + + + ==(_:_:) + +
      +
      +
      +
      +
      +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      static public func == (e1: CommandError, e2: CommandError) -> Bool
      + +
      +
      +
      +
      +
    • +
    +
    diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html index 8b3dcf3..3140830 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Enums/FileError.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -257,9 +266,9 @@
  • - + - description + description
    @@ -285,7 +294,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html index f3b42a6..2ce024a 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -213,6 +222,36 @@ +
    + + +
    • @@ -270,7 +309,7 @@
      -

      Let Strings run commands using itself as stdin.

      +

      Lets String run commands using itself as stdin.

      See more
      @@ -309,7 +348,7 @@

      Declaration

      Swift

      -
      protocol LazyCollectionProtocol : Collection, LazySequenceProtocol
      +
      protocol LazyCollectionProtocol : Collection, LazySequenceProtocol where Self.Elements : Collection
    @@ -321,7 +360,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html index 2d732ca..345c56a 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/FileHandle.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -209,7 +218,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html index ab27631..6b784be 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/LazyCollectionProtocol.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -182,7 +191,7 @@

    LazyCollectionProtocol

    -
    protocol LazyCollectionProtocol : Collection, LazySequenceProtocol
    +
    protocol LazyCollectionProtocol : Collection, LazySequenceProtocol where Self.Elements : Collection
    @@ -194,9 +203,9 @@
  • - + - split(separator:allowEmptySlices:) + split(separator:allowEmptySlices:)
    @@ -212,7 +221,7 @@

    Swift

    public func split(
    -	separator: Elements.Iterator.Element, allowEmptySlices: Bool = false
    +	separator: Elements.Element, allowEmptySlices: Bool = false
     	) -> LazySplitSequence<Elements>
    @@ -257,7 +266,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 6144ed1..6ad766d 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/Process.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/Process.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -188,9 +197,9 @@
  • - - - launchThrowably() + + + terminate()
    @@ -198,21 +207,8 @@
    -

    Launch process.

    -
    -

    Throws

    - CommandError.inAccessibleExecutable if command could not be executed. +

    Terminates the command by sending the SIGTERM signal

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func launchThrowably() throws
    - -
    @@ -220,9 +216,9 @@
  • - - - finish() + + + interrupt()
    @@ -230,21 +226,46 @@
    -

    Wait until process is finished.

    -
    -

    Throws

    - CommandError.returnedErrorCode(command: String, errorcode: Int) if the exit code is anything but 0. - -
    +

    Interrupts the command by sending the SIGINT signal

    -
    -

    Declaration

    -
    -

    Swift

    -
    public func finish() throws
    +
    +
    +
  • +
  • +
    + + + + suspend() + +
    +
    +
    +
    +
    +
    +

    Temporarily suspends a command. Call resume() to resume a suspended command

    + +
    +
    +
    +
  • +
  • +
    + + + + resume() + +
    +
    +
    +
    +
    +
    +

    Resumes a command previously suspended with suspend().

    -
    @@ -254,7 +275,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html index b3a0c4e..4079538 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Extensions/String.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -186,7 +195,7 @@ -

    Let Strings run commands using itself as stdin.

    +

    Lets String run commands using itself as stdin.

    @@ -195,9 +204,9 @@
  • - + - context + context
    @@ -236,7 +245,7 @@
    -

    Split text into lines (as separated by newlines).

    +

    Splits text into lines (as separated by newlines).

    @@ -255,7 +264,7 @@
  • diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html index 7c73845..cfaafd4 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Functions.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@ + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -263,7 +272,7 @@
    -

    Run bash command and return before it is finished.

    +

    Runs bash command and returns before it is finished.

    @@ -293,9 +302,52 @@
    +
    + + +
  • +
    + + + + runAsyncAndPrint(bash:file:line:) + +
    +
    +
    +
    +
    +
    +

    Runs bash command and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(bash bashcommand: String, file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    -

    Return Value

    -

    an AsyncCommand struct with standard output, standard error and a ‘finish’ function.

    +

    Parameters

    + + + + + + + +
    + + bashcommand + + +
    +

    the bash shell command.

    +
    +
    @@ -313,7 +365,7 @@
    -

    Run bash command and print output and errors.

    +

    Runs bash command and prints output and errors.

    Throws

    a CommandError.returnedErrorCode if the return code is anything but 0. @@ -375,7 +427,7 @@
    -

    Print message to standard error and halt execution.

    +

    Prints message to standard error and terminates the application.

    @@ -437,7 +489,7 @@
    -

    Print error to standard error and halt execution.

    +

    Prints error to standard error and terminates the application.

    @@ -476,44 +528,6 @@
  • -
    - - -
    @@ -526,9 +540,9 @@
  • @@ -596,9 +610,9 @@
  • @@ -606,10 +620,10 @@
    -

    Run executable and return before it is finished.

    +

    Runs executable and returns before it is finished.

    Warning

    - will crash if ‘executable’ could not be launched. + Application will be terminated if ‘executable’ could not be launched.
    @@ -634,7 +648,7 @@
    -

    path to an executable file.

    +

    Path to an executable file. If not then exit.

    @@ -646,26 +660,22 @@
    -

    arguments to the executable.

    +

    Arguments to the executable.

    -
    -

    Return Value

    -

    an AsyncCommand with standard output, standard error and a ‘finish’ function.

    -
  • @@ -673,7 +683,71 @@
    -

    Run executable and print output and errors.

    +

    Runs executable and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    +
    +

    Warning

    + Application will be terminated if ‘executable’ could not be launched. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + executable + + +
    +

    Path to an executable file. If not then exit.

    +
    +
    + + args + + +
    +

    Arguments to the executable.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + runAndPrint(_:_:) + +
    +
    +
    +
    +
    +
    +

    Runs executable and prints output and errors.

    Throws

    CommandError.returnedErrorCode(command: String, errorcode: Int) if the exit code is anything but 0.

    @@ -742,7 +816,7 @@
    -

    Append file or directory url to directory url

    +

    Appends file or directory url to directory url

    @@ -769,14 +843,14 @@
    -

    Open a file for reading, throw if an error occurs.

    +

    Opens a file for reading, throws if an error occurs.

    Declaration

    Swift

    -
    public func open(_ path: String, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    +
    public func open(_ path: String, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    @@ -796,14 +870,14 @@
    -

    Open a file for reading, throw if an error occurs.

    +

    Opens a file for reading, throws if an error occurs.

    Declaration

    Swift

    -
    public func open(_ path: URL, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    +
    public func open(_ path: URL, encoding: String.Encoding = main.encoding) throws -> ReadableStream
    @@ -823,7 +897,7 @@
    -

    Open a file for writing, create it first if it doesn’t exist. +

    Opens a file for writing, creates it first if it doesn’t exist. If the file already exists and overwrite=false, the writing will begin at the end of the file.

    @@ -831,7 +905,7 @@ If the file already exists and overwrite=false, the writing will begin at the en

    Declaration

    Swift

    -
    public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    +
    public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    @@ -870,7 +944,7 @@ If the file already exists and overwrite=false, the writing will begin at the en
    -

    Open a file for writing, create it first if it doesn’t exist. +

    Opens a file for writing, creates it first if it doesn’t exist. If the file already exists and overwrite=false, the writing will begin at the end of the file.

    @@ -878,7 +952,7 @@ If the file already exists and overwrite=false, the writing will begin at the en

    Declaration

    Swift

    -
    public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    +
    public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream
    @@ -940,7 +1014,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 a63713a..3b668ee 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Global Variables.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Global Variables.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -188,9 +197,9 @@
  • - + - main + main
    @@ -219,9 +228,9 @@
  • - + - Files + Files
    @@ -248,7 +257,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html index 796a07f..61ae3e6 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -336,7 +345,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html index 2020ed6..a4d256f 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/CommandRunning.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - context + context Default implementation @@ -308,7 +317,7 @@
    -

    Run bash command and return before it is finished.

    +

    Runs bash command and returns before it is finished.

    @@ -338,9 +347,55 @@
    +
    +
    +
  • +
  • +
    + + + + runAsyncAndPrint(bash:file:line:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Runs bash command and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(bash bashcommand: String, file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    -

    Return Value

    -

    an AsyncCommand struct with standard output, standard error and a ‘finish’ function.

    +

    Parameters

    + + + + + + + +
    + + bashcommand + + +
    +

    the bash shell command.

    +
    +
    @@ -361,7 +416,7 @@
    -

    Run bash command and print output and errors.

    +

    Runs bash command and prints output and errors.

    Throws

    a CommandError.returnedErrorCode if the return code is anything but 0. @@ -406,9 +461,9 @@
  • - + - run(_:_:combineOutput:) + run(_:_:combineOutput:) Extension method @@ -483,9 +538,9 @@
  • - + - runAsync(_:_:file:line:) + runAsync(_:_:file:line:) Extension method @@ -496,10 +551,10 @@
    -

    Run executable and return before it is finished.

    +

    Runs executable and returns before it is finished.

    Warning

    - Will crash if ‘executable’ could not be launched. + Application will be terminated if ‘executable’ could not be launched.
    @@ -543,9 +598,72 @@
    +
    +
    +
  • +
  • +
    + + + + runAsyncAndPrint(_:_:file:line:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Runs executable and returns before it is finished. +Any output is printed to standard output and standard error, respectively.

    +
    +

    Warning

    + Application will be terminated if ‘executable’ could not be launched. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func runAsyncAndPrint(_ executable: String, _ args: Any ..., file: String = #file, line: Int = #line) -> PrintedAsyncCommand
    + +
    +
    -

    Return Value

    -

    An AsyncCommand with standard output, standard error and a ‘finish’ function.

    +

    Parameters

    + + + + + + + + + + + +
    + + executable + + +
    +

    Path to an executable file. If not then exit.

    +
    +
    + + args + + +
    +

    Arguments to the executable.

    +
    +
    @@ -557,9 +675,9 @@
  • - + - runAndPrint(_:_:) + runAndPrint(_:_:) Extension method @@ -570,7 +688,7 @@
    -

    Run executable and print output and errors.

    +

    Runs executable and prints output and errors.

    Throws

    CommandError.returnedErrorCode(command: String, errorcode: Int) if the exit code is anything but 0.

    @@ -627,7 +745,7 @@
  • diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html index e650922..0645bce 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/Context.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - env + env
    @@ -222,9 +231,9 @@
  • - + - stdin + stdin
    @@ -249,9 +258,9 @@
  • - + - stdout + stdout
    @@ -276,9 +285,9 @@
  • - + - stderror + stderror
    @@ -303,9 +312,9 @@
  • @@ -337,9 +346,9 @@ separate process and changing the directory there will not affect the rest of th
  • - + - debugDescription + debugDescription Extension method @@ -369,7 +378,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 6013db9..23136bd 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/ReadableStream.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/ReadableStream.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - encoding + encoding
    @@ -222,9 +231,9 @@
  • @@ -417,9 +426,9 @@ If the stream is empty and still open this will wait for more content or end-of-
  • - + - context + context Extension method @@ -496,14 +505,17 @@ If the stream is empty and still open this will wait for more content or end-of-
    -

    Reads everything at once.

    +

    Reads everything at once. +Marked with @discardableResult so that the stream can be read before +calling .finish() without causing any compiler warnings or requiring +developer work-arounds when the result will not be used (see #52 & #57)

    Declaration

    Swift

    -
    public func readData() -> Data
    +
    @discardableResult public func readData() -> Data
    @@ -530,11 +542,11 @@ If the stream is empty and still open this will wait for more content or end-of-
    -

    handler will be called whenever there is new output available.

    +

    Sets code to be executed whenever there is new output available.

    Note

    - if the stream is read from outside of the handler, or more than once inside -the handler, it may be called once when stream is closed and empty. + if the stream is read from outside of handler, or more than once inside +it, it may be called once when stream is closed and empty.
    @@ -566,11 +578,11 @@ the handler, it may be called once when stream is closed and empty.
    -

    handler will be called whenever there is new text output available.

    +

    Sets code to be executed whenever there is new text output available.

    Note

    - if the stream is read from outside of the handler, or more than once inside -the handler, it may be called once when stream is closed and empty. + if the stream is read from outside of handler, or more than once inside +it, it may be called once when stream is closed and empty.
    @@ -591,7 +603,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 00fdc76..6e8e8eb 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/WritableStream.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Protocols/WritableStream.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables
  • @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - encoding + encoding
    @@ -222,9 +231,9 @@
  • @@ -323,9 +332,9 @@ to prevent deadlock when reading.

  • - + - print(_:separator:terminator:) + print(_:separator:terminator:) Extension method @@ -431,7 +440,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 28b4570..1833c91 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@
  • + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -239,8 +248,7 @@

    Swift

    public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    -	Base.SubSequence: Collection
    + Base.Element: Equatable
    @@ -269,7 +277,7 @@

    Swift

    public struct PartialSourceLazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    +	Base.Element: Equatable,
     	Base.SubSequence: RangeReplaceableCollection
    @@ -282,7 +290,7 @@ diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html index b1353bc..b9b6e08 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/CustomContext.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@ + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -195,9 +204,9 @@
  • - + - env + env
    @@ -222,9 +231,9 @@
  • - + - stdin + stdin
    @@ -249,9 +258,9 @@
  • - + - stdout + stdout
    @@ -276,9 +285,9 @@
  • - + - stderror + stderror
    @@ -303,9 +312,9 @@
  • - + - currentdirectory + currentdirectory
    @@ -390,7 +399,7 @@ currentdirectory is the current working directory.

    diff --git a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html index 2e257f9..a9df93c 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/LazySplitSequence.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -183,8 +192,7 @@
    public struct LazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    -	Base.SubSequence: Collection
    + Base.Element: Equatable
    @@ -197,9 +205,9 @@
  • - + - remaining + remaining
    @@ -224,9 +232,9 @@
  • - + - separator + separator
    @@ -241,7 +249,7 @@

    Declaration

    Swift

    -
    public let separator: Base.Iterator.Element
    +
    public let separator: Base.Element
    @@ -251,9 +259,9 @@
  • - + - allowEmptySlices + allowEmptySlices
    @@ -295,7 +303,7 @@

    Declaration

    Swift

    -
    public init(_ base: Base, separator: Base.Iterator.Element, allowEmptySlices: Bool = false)
    +
    public init(_ base: Base, separator: Base.Element, allowEmptySlices: Bool = false)
    @@ -378,7 +386,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 be9e0b0..f039b82 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/PartialSourceLazySplitSequence.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/Structs/PartialSourceLazySplitSequence.html @@ -14,7 +14,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -40,6 +40,9 @@
  • + @@ -52,10 +55,10 @@ Global Variables @@ -85,6 +88,9 @@ + @@ -96,9 +102,6 @@ - @@ -118,23 +121,29 @@ open(forWriting:overwrite:encoding:) + + @@ -183,7 +192,7 @@
    public struct PartialSourceLazySplitSequence <Base: Collection>: IteratorProtocol, LazySequenceProtocol where
    -	Base.Iterator.Element: Equatable,
    +	Base.Element: Equatable,
     	Base.SubSequence: RangeReplaceableCollection
    @@ -214,7 +223,7 @@

    Declaration

    Swift

    -
    public init(_ bases: @escaping () -> Base?, separator: Base.Iterator.Element)
    +
    public init(_ bases: @escaping () -> Base?, separator: Base.Element)
    @@ -285,7 +294,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 4e81c79..5850f5d 100644 --- a/docsets/SwiftShell.docset/Contents/Resources/Documents/index.html +++ b/docsets/SwiftShell.docset/Contents/Resources/Documents/index.html @@ -13,7 +13,7 @@
    -

    SwiftShell Docs (70% documented)

    +

    SwiftShell Docs (73% documented)

    View on GitHub

    @@ -39,6 +39,9 @@ + @@ -51,10 +54,10 @@ Global Variables @@ -84,6 +87,9 @@ + @@ -95,9 +101,6 @@ - @@ -117,23 +120,29 @@ open(forWriting:overwrite:encoding:) + + @@ -301,7 +310,7 @@

    You can create a copy of your application’s context: let context = CustomContext(main), or create a new empty one: let context = CustomContext(). Everything is mutable, so you can set e.g. the current directory or redirect standard error to a file.

    Main context

    -

    The global variable main is the Context for the application itself. In addition to the properties mentioned above it also has these:

    +

    The global variable main is the Context for the application itself. In addition to the properties mentioned above it also has these: