https://github.com/smittytone/clicore
Core CLI components for Swift-based tools
https://github.com/smittytone/clicore
Last synced: 4 months ago
JSON representation
Core CLI components for Swift-based tools
- Host: GitHub
- URL: https://github.com/smittytone/clicore
- Owner: smittytone
- License: mit
- Created: 2025-08-17T20:28:28.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-08-17T20:32:14.000Z (5 months ago)
- Last Synced: 2025-08-17T22:19:49.419Z (5 months ago)
- Language: Swift
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# clicore 0.1.0
This repo contains core CLI functionality used by my Swift CLI apps and utilities.
## Installation
* `cd /path/to/project`
* `git submodule add https://github.com/smittytone/clicore`
* Add the files you require to your project, eg. in Xcode.
* Make sure you select **Reference files in place**.
## Installation (Swift PM)
* Add the package as a dependency in Xcode or your project’s own `Package.swift` file.
## Usage
Each file provides generic CLI functionality. Each includes a Swift struct containing zero or more subsidiary structs and enums. Functions are declared static so do not require a specific instance to be generated. Instead, think of the struct name as a namespace, a bit like C++, but with dot syntax rather than `::`.
### Example
```swift
// Set up Ctrl-C handling
Stdio.enableCtrlHandler("utitool interrupted -- halting")
```