Documented the App and its AppOptions types in the app target.
This commit is contained in:
parent
3ee7878c02
commit
b97c19f972
@ -1,14 +1,17 @@
|
||||
import ArgumentParser
|
||||
import DoxyLibrary
|
||||
|
||||
/// A command type that runs the service based on given of set of option parameters.
|
||||
@main struct Doxy: AsyncParsableCommand {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
|
||||
/// An option type that contains all the possible parameters that can be provided to the service.
|
||||
@OptionGroup var options: Options
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
|
||||
/// Runs the service.
|
||||
mutating func run() async throws {
|
||||
let appBuilder = AppBuilder(
|
||||
name: options.name,
|
||||
|
@ -3,34 +3,40 @@ import DoxyLibrary
|
||||
import Logging
|
||||
|
||||
extension Doxy {
|
||||
/// An option type that contains all the possible parameters that can be provided to the application.
|
||||
struct Options: AppArguments, ParsableArguments {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
|
||||
/// A path to the location of the DocC archives in the local file system.
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "A path to the location of the DocC archives in the local file system."
|
||||
help: "A path to the location of the DocC archives in the local file system. Defaults to `Resources/Archives`."
|
||||
)
|
||||
var archivesPath: String = "Resources/Archives"
|
||||
|
||||
|
||||
/// A hostname to bind the application to.
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "A hostname to bind the application to. Defaults to `127.0.0.1`."
|
||||
)
|
||||
var hostname: String = "127.0.0.1"
|
||||
|
||||
/// A log level to set the logger service in the application.
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "A log level to set the logger service in the application."
|
||||
)
|
||||
var logLevel: Logger.Level?
|
||||
|
||||
|
||||
/// A name for the Hummingbird application.
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "A name for the Hummingbird application."
|
||||
help: "A name for the Hummingbird application. Defaults to `Doxy`."
|
||||
)
|
||||
var name: String = "Doxy"
|
||||
|
||||
/// A port number to bind the application to.
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "A port number to bind the application to. Defaults to `8080`."
|
||||
|
Loading…
x
Reference in New Issue
Block a user