Swiftpack.co - Ponyboy47/PathComplete as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Ponyboy47.
Ponyboy47/PathComplete 0.3.0
Swift path completion
⭐️ 0
🕓 4 years ago
macOS
.package(url: "https://github.com/Ponyboy47/PathComplete.git", from: "0.3.0")

PathComplete

A simple utility for completing paths when given a directory and pathname prefix

Installation (SPM)

.package(url: "https://github.com/Ponyboy47/PathComplete.git", from: "0.3.0")

Usage

let dir = DirectoryPath("/tmp")!

// Just returns everything in /tmp
var completions: DirectoryChildren = try dir.complete()

// Returns everything that begins with "log"
completions = try dir.complete("log")

// Return only the files found in /tmp
completions = try dir.complete(types: [.file])

// Opening the directory makes the completion function safe
let opened = try dir.open()

// Just returns everything in /tmp
completions = opened.complete()

// Returns everything that begins with "log"
completions = opened.complete("log")

// Return only the files found in /tmp
completions = opened.complete(types: [.file])

License

MIT

GitHub

link
Stars: 0
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics