A simple utility for completing paths when given a directory and pathname prefix
.package(url: "https://github.com/Ponyboy47/PathComplete.git", from: "0.3.0")
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])
MIT
link |
Stars: 0 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics