2025-02-22 10:21:07 +01:00
|
|
|
import ArgumentParser
|
2025-03-09 22:53:45 +01:00
|
|
|
import DoxyLibrary
|
2025-02-22 10:21:07 +01:00
|
|
|
import Logging
|
|
|
|
|
2025-03-27 00:04:51 +01:00
|
|
|
extension Doxy {
|
2025-03-27 00:30:49 +01:00
|
|
|
/// An option type that contains all the possible parameters that can be provided to the application.
|
2025-02-22 10:21:07 +01:00
|
|
|
struct Options: AppArguments, ParsableArguments {
|
2025-03-26 00:26:57 +01:00
|
|
|
|
2025-02-22 10:21:07 +01:00
|
|
|
// MARK: Properties
|
2025-03-27 00:30:49 +01:00
|
|
|
|
|
|
|
/// A path to the location of the DocC archives in the local file system.
|
2025-03-26 00:26:57 +01:00
|
|
|
@Option(
|
2025-03-27 01:48:31 +01:00
|
|
|
name: .long,
|
2025-04-01 00:24:42 +02:00
|
|
|
help: "A path to the location of the DocC archives in the local file system."
|
2025-03-26 00:26:57 +01:00
|
|
|
)
|
2025-04-01 00:24:42 +02:00
|
|
|
var archivesPath: String
|
2025-03-27 00:30:49 +01:00
|
|
|
|
|
|
|
/// A hostname to bind the application to.
|
2025-03-09 23:33:23 +01:00
|
|
|
@Option(
|
2025-03-27 01:48:31 +01:00
|
|
|
name: .long,
|
2025-03-09 23:33:23 +01:00
|
|
|
help: "A hostname to bind the application to. Defaults to `127.0.0.1`."
|
|
|
|
)
|
2025-02-22 10:21:07 +01:00
|
|
|
var hostname: String = "127.0.0.1"
|
2025-03-09 00:11:49 +01:00
|
|
|
|
2025-03-27 00:30:49 +01:00
|
|
|
/// A log level to set the logger service in the application.
|
2025-03-09 23:33:23 +01:00
|
|
|
@Option(
|
2025-03-27 01:48:31 +01:00
|
|
|
name: .long,
|
2025-03-09 23:33:23 +01:00
|
|
|
help: "A log level to set the logger service in the application."
|
|
|
|
)
|
2025-03-09 00:11:49 +01:00
|
|
|
var logLevel: Logger.Level?
|
2025-03-27 00:30:49 +01:00
|
|
|
|
|
|
|
/// A name for the Hummingbird application.
|
2025-03-26 00:26:57 +01:00
|
|
|
@Option(
|
2025-03-27 01:48:31 +01:00
|
|
|
name: .long,
|
2025-03-27 00:30:49 +01:00
|
|
|
help: "A name for the Hummingbird application. Defaults to `Doxy`."
|
2025-03-26 00:26:57 +01:00
|
|
|
)
|
|
|
|
var name: String = "Doxy"
|
2025-02-22 10:21:07 +01:00
|
|
|
|
2025-03-27 00:30:49 +01:00
|
|
|
/// A port number to bind the application to.
|
2025-03-09 23:33:23 +01:00
|
|
|
@Option(
|
2025-03-27 01:48:31 +01:00
|
|
|
name: .long,
|
2025-03-09 23:33:23 +01:00
|
|
|
help: "A port number to bind the application to. Defaults to `8080`."
|
|
|
|
)
|
2025-02-22 10:21:07 +01:00
|
|
|
var port: Int = 8080
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|