All Projects → getGuaka → Process

getGuaka / Process

Licence: MIT License
A POSIX compliant library to run external applications in Swift.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Process

punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (+78.57%)
Mutual labels:  carthage
Lighty
Easy to use and lightweight logger for iOS, macOS, tvOS, watchOS and Linux in Swift.
Stars: ✭ 49 (+250%)
Mutual labels:  carthage
BubbleShowCase-iOS
ShowCase is a framework that provides with a view that you can display to help your users understand your App features
Stars: ✭ 36 (+157.14%)
Mutual labels:  carthage
termijack
TermiJack surreptitiously hijacks standard streams (stdin, stdout, and/or stderr) from an already running process.
Stars: ✭ 166 (+1085.71%)
Mutual labels:  stdout
Cathay
an iOS project for demonstration of Reactive Programming
Stars: ✭ 21 (+50%)
Mutual labels:  carthage
validation-components
A collection of common validation predicates for ValidationToolkit framework
Stars: ✭ 26 (+85.71%)
Mutual labels:  carthage
swift-ipify
Swift library for checking your IP address from ipify.org
Stars: ✭ 37 (+164.29%)
Mutual labels:  carthage
clevertap-ios-sdk
CleverTap iOS SDK
Stars: ✭ 39 (+178.57%)
Mutual labels:  carthage
AlertBar
An easy alert on status bar
Stars: ✭ 64 (+357.14%)
Mutual labels:  carthage
BetterMappable
Better Mappable through Property Wrappers using ObjectMapper
Stars: ✭ 26 (+85.71%)
Mutual labels:  carthage
BlockiesSwift
Unique blocky identicons generator for Swift
Stars: ✭ 53 (+278.57%)
Mutual labels:  carthage
ntee
Portable Unix shell command 'tee', with some extras - read from standard input and write to standard output and files
Stars: ✭ 22 (+57.14%)
Mutual labels:  stdout
SwiftVer
Easily Manage Versioning in MacOS, iOS, watchOS, and tvOS projects.
Stars: ✭ 23 (+64.29%)
Mutual labels:  carthage
Klendario
A Swift wrapper over the EventKit framework
Stars: ✭ 44 (+214.29%)
Mutual labels:  carthage
SwiftyAcknowledgements
Integrate acknowledgements into your iOS App
Stars: ✭ 40 (+185.71%)
Mutual labels:  carthage
lwprintf
Lightweight printf library optimized for embedded systems
Stars: ✭ 98 (+600%)
Mutual labels:  stdout
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (+471.43%)
Mutual labels:  carthage
HTTPDNS-OC
HTTPDNS 库 Objdctive-C 实现(使用DNSPod 、AliyunDNS、 Google ...)
Stars: ✭ 33 (+135.71%)
Mutual labels:  carthage
PXDToolkit
A collection of Swift utility extensions and functions
Stars: ✭ 14 (+0%)
Mutual labels:  carthage
NeumorphismTab
Custom TabBarController with Neumorphism.
Stars: ✭ 78 (+457.14%)
Mutual labels:  carthage

Process

Build Status codecov Platform Language: Swift Carthage

A posix-compliant library to run external applications and capture the standard out and standard error.

Why?

If you are developing cross platform command line apps, you need an easy way to run external applications. Process provides just that.

You can use Process with Guaka to create aweseome command line applications.

Usage

To execute a simple command you would do:

let result = Process.exec("ls -a -l")
print(result.stdout)

result type is RunResults, it contains:

  • exitStatus: The command exit status
  • stdout: The standard output for the command executed
  • stderr: The standard error for the command executed

To customize the run function, you can pass in a customization block:

let result = Process.exec("ls -all") { settings in
    settings.dryRun = true
    settings.echo = [.Stdout, .Stderr, .Command]
    settings.interactive = false
}

settings is an instance of RunSettings, which contains the following variables:

  • settings.dryRun: defaults to false. If false, the command is actually run. If true, the command is logged to the stdout paramter of result
  • settings.echo: Customize the message printed to stdout, echo can contain any of the following:
    • EchoSettings.Stdout: The stdout returned from running the command will be printed to the terminal
    • EchoSettings.Stderr: The stderr returned from running the command will be printed to the terminal
    • EchoSettings.Command: The command executed will be printed to the terminal

Installation

You can install Process using Swift package manager (SPM) and carthage

Swift Package Manager

Add Process as dependency in your Package.swift

  import PackageDescription

  let package = Package(name: "YourPackage",
    dependencies: [
      .Package(url: "https://github.com/oarrabi/Process.git", majorVersion: 0),
    ]
  )

Carthage

github 'oarrabi/Process'

Tests

Tests can be found here.

Run them with

swift test

Contributing

Just send a PR! We don't bite ;)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].