A minimal, pure Swift library for making command-line tools / interfaces.

Overview

SwiftArgs

This library is no longer maintained. Please use Swift Argument Parser instead.

A minimal, pure Swift library for making command-line tools / interfaces.

Travis build status codebeat SPM Swift version

SwiftArgs uses a very basic and limited parser for parsing commands, but it should suffice for basic usage requirements. You can use SwiftArgs when making a command-line interface in Swift and let it do the parsing work for you.

Contributions welcome.


Install

Using Swift Package Manager:

dependencies: [
  .Package(url: "https://github.com/frazer-rbsn/SwiftArgs", majorVersion: 1.1),
]

Limitations

  • Hasn't been tested on Linux.
  • Currently no support for subcommands
  • Doesn't support short-form option switches yet, e.g. mycommand -o
You might also like...
A nifty command-line tool to customize macOS icons

iconset A nifty command line tool to manage macOS icons iconset is a new command line tool for macOS that allows you to change icons for macOS apps (e

🕳 A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image.

HolePunch NAME holepunch -- A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image. SYNOPSIS holepu

The best command-line tool to install and switch between multiple versions of Xcode.
The best command-line tool to install and switch between multiple versions of Xcode.

The best command-line tool to install and switch between multiple versions of Xcode.

Command Line Tool for interacting with MachO binaries on OSX/iOS

inject inject is a tool which interfaces with MachO binaries in order to insert load commands. Below is its help. ➜ ./inject -h OVERVIEW: inject v1.0.

ips2crash is a macOS command line too to convert a .ips file to a legacy .crash log file.

Synopsis ips2crash is a macOS command line too to convert a .ips file to a legacy .crash log file. Motivation It should be possible to read .ips file

CookCLI is provided as a command-line tool to make Cook recipe management easier

CookCLI is provided as a command-line tool to make Cook recipe management easier, and enable automation and scripting workflows for the CookLa

Adjust the volume from the command line on macOS.

volume Adjust the volume from the command line on macOS. Installation Using Mint: mint install meowmeowmeowcat/[email protected] Usage USAGE: volume numb

A Mac command-line tool that automatically downloads macOS Installers / Firmwares.
A Mac command-line tool that automatically downloads macOS Installers / Firmwares.

MIST - macOS Installer Super Tool A Mac command-line tool that automatically downloads macOS Installers / Firmwares: Features List all available macOS

macOS command line tool to return the available disk space on APFS volumes

diskspace Returns available disk space With the various APFS features the value for free disk space returned from tools such as du or df will not be a

Releases(3.0.4)
  • 3.0.4(Nov 10, 2019)

  • 3.0.3(Sep 15, 2019)

  • 3.0.2(Sep 15, 2019)

  • 3.0.1(Sep 14, 2019)

  • 3.0.0(Sep 14, 2019)

    • Extensible CommandName, ArgumentName and OptionName structs, used in the same way as Foundation's Notification.Name.
    • Parsed models use dictionaries with the related name struct as the key.
    Source code(tar.gz)
    Source code(zip)
  • 2.0.2(Sep 8, 2019)

  • 2.0.1(Sep 8, 2019)

  • 2.0.0(Sep 8, 2019)

  • 1.1.0(Sep 7, 2019)

  • 1.0.0(Jun 9, 2017)

    CommandParser.parseCommandLine(_:) no longer throws. Instead, you can handle parsing errors in a new CommandParserDelegate function, parserError(_:). This makes it easy to run parsing in a background thread and for better separation of concerns.

    class Delegate : CommandParserDelegate {
    
      /**
       Called if there was a problem.
       */
      func parserError(error : CommandParserError) {
        //Handle error
      }
      
      /**
       Called if there were no command-line arguments supplied to your program.
       */
      func commandNotSupplied() {
        //Handle commands not supplied
      }
      
      /**
       Called if a command was parsed successfully.
       */
      func receivedCommand(command : Command) {
        //Handle successfully-parsed commands
      }
    }
    
    let delegate = Delegate()
    let commandParser = CommandParser()
    commandParser.parseCommandLine(delegate: delegate)
    
    
    Source code(tar.gz)
    Source code(zip)
Owner
Frazer Robinson
Frazer Robinson
Simple & Elegant Command Line Interfaces in Swift

An elegant pure Swift library for building command line applications. Features Tons of class, but no classes. 100% organic pure value types. Auto gene

hypertalk 52 Nov 9, 2022
Simple & Elegant Command Line Interfaces in Swift

An elegant pure Swift library for building command line applications. Features Tons of class, but no classes. 100% organic pure value types. Auto gene

hypertalk 52 Nov 9, 2022
Swift-cli - Example of building command-line tools in Swift

swift-cli Example of building command-line tools in Swift Step 1: Create CLI wit

Noah Gift 2 Jan 17, 2022
Swiftline is a set of tools to help you create command line applications

Swiftline is a set of tools to help you create command line applications. Swiftline is inspired by highline Swiftline contains the following: Colorize

Omar Abdelhafith 1.2k Dec 29, 2022
Linenoise-Swift A pure Swift implementation of the Linenoise library. A minimal, zero-config readline replacement.

Linenoise-Swift A pure Swift implementation of the Linenoise library. A minimal, zero-config readline replacement. Supports Mac OS and Linux Line edit

Andy Best 114 Dec 14, 2022
Command line utility to profile compilation time of Swift project.

xcprofiler Command line utility to profile compilation time of Swift project. This tool is developed in working time for Cookpad. Installation gem ins

Kohki Miki 334 Jan 3, 2023
Josephus - A command line tool to solve Josephus problem in Swift

josephus A command line tool to solve Josephus problem in Swift

Masahiro Oono 0 Jan 25, 2022
A Mac command-line tool that generates kick-ass Jamf Pro reports.

KMART - Kick-Ass Mac Admin Reporting Tool A command-line utility generating kick-ass Jamf Pro reports: Features Reporting on the following Jamf Pro ob

Nindi Gill 86 Dec 15, 2022
ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

Majd Alfhaily 3k Dec 30, 2022
iOS command-line tool that allows searching and downloading ipa files from the iOS App Store

ipatool for iOS This is a port of Majd Alfhaily's ipatool adapted to run on iOS Build / Installation To build this, make sure you have AppSync install

dan 21 Sep 13, 2022