Placeholder install-command
This commit is contained in:
parent
7f4575fdba
commit
a92d9bd550
|
@ -1,3 +1,11 @@
|
|||
# xcode-simulator-tool
|
||||
|
||||
A description of this package.
|
||||
|
||||
## TODO
|
||||
|
||||
* PEM parser
|
||||
* `install-ca` command
|
||||
* Filter for os types
|
||||
* Find out why the argument parsin errors are not printed correctly
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ struct CommandLineOptions {
|
|||
private let parser: ArgumentParser
|
||||
private(set) var subCommand: SubCommand
|
||||
|
||||
private static let allCommands: [Command] = [ListDevicesCommand()]
|
||||
private static let allCommands: [Command] = [ListDevicesCommand(), InstallCACommand()]
|
||||
|
||||
static func parse(commandName: String, arguments: [String]) throws -> CommandLineOptions {
|
||||
let parser = ArgumentParser(
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// Copyright © 2019 Simon Kågedal Reimer. See LICENSE.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SPMUtility
|
||||
|
||||
struct InstallCACommand: Command {
|
||||
let name = "install-ca"
|
||||
let overview = "Install a Certificate Authority"
|
||||
|
||||
private let binder = ArgumentBinder<InstallCACommand>()
|
||||
|
||||
func addOptions(to parser: ArgumentParser) {
|
||||
binder.bind(positional: parser.add(
|
||||
positional: "path",
|
||||
kind: String.self
|
||||
), to: { command, path in
|
||||
print("Chosen path: \(path)")
|
||||
})
|
||||
}
|
||||
|
||||
mutating func fillParseResult(_ parseResult: ArgumentParser.Result) throws {
|
||||
try binder.fill(parseResult: parseResult, into: &self)
|
||||
}
|
||||
|
||||
func run() throws {
|
||||
print("Running!")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue