Added the "archivesPath" and the "name" properties to the AppArguments protocol in the library target.
This commit is contained in:
parent
1f81286a8b
commit
f9fc29c8da
@ -4,9 +4,15 @@ import Logging
|
|||||||
|
|
||||||
extension App {
|
extension App {
|
||||||
struct Options: AppArguments, ParsableArguments {
|
struct Options: AppArguments, ParsableArguments {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
|
@Option(
|
||||||
|
name: .shortAndLong,
|
||||||
|
help: "A path to the location of the DocC archives in the local file system."
|
||||||
|
)
|
||||||
|
var archivesPath: String = "Resources/Archives"
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name: .shortAndLong,
|
name: .shortAndLong,
|
||||||
help: "A hostname to bind the application to. Defaults to `127.0.0.1`."
|
help: "A hostname to bind the application to. Defaults to `127.0.0.1`."
|
||||||
@ -18,6 +24,12 @@ extension App {
|
|||||||
help: "A log level to set the logger service in the application."
|
help: "A log level to set the logger service in the application."
|
||||||
)
|
)
|
||||||
var logLevel: Logger.Level?
|
var logLevel: Logger.Level?
|
||||||
|
|
||||||
|
@Option(
|
||||||
|
name: .shortAndLong,
|
||||||
|
help: "A name for the Hummingbird application."
|
||||||
|
)
|
||||||
|
var name: String = "Doxy"
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name: .shortAndLong,
|
name: .shortAndLong,
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
import Logging
|
import Logging
|
||||||
|
|
||||||
/// A type that defines the input arguments that the `Hummingbird`app receives.
|
/// A protocol that defines the input arguments an application receives from the command line.
|
||||||
public protocol AppArguments {
|
public protocol AppArguments {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
|
/// A path to the location of the DocC archives in the local file system.
|
||||||
|
var archivesPath: String { get }
|
||||||
|
|
||||||
/// A bind address for the app.
|
/// A bind address for the app.
|
||||||
var hostname: String { get }
|
var hostname: String { get }
|
||||||
|
|
||||||
/// A logging level to configure for the app.
|
/// A logging level to configure for the app.
|
||||||
var logLevel: Logger.Level? { get }
|
var logLevel: Logger.Level? { get }
|
||||||
|
|
||||||
|
/// A name for the app.
|
||||||
|
var name: String { get }
|
||||||
|
|
||||||
/// A port for the app to use,
|
/// A port for the app to use,
|
||||||
var port: Int { get }
|
var port: Int { get }
|
||||||
|
|
||||||
|
@ -2,9 +2,11 @@ import DoxyLibrary
|
|||||||
import Logging
|
import Logging
|
||||||
|
|
||||||
struct TestArguments: AppArguments {
|
struct TestArguments: AppArguments {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
|
let name = "DoxyTest"
|
||||||
|
let archivesPath = "Resources/Archives/Test"
|
||||||
let hostname = "127.0.0.1"
|
let hostname = "127.0.0.1"
|
||||||
let logLevel: Logger.Level? = .trace
|
let logLevel: Logger.Level? = .trace
|
||||||
let port = 0
|
let port = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user