File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Examples/HelloWorldWithResources Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,15 @@ let package = Package(
2222 dependencies: [
2323 . package ( url: " https://github.com/hummingbird-project/hummingbird.git " , from: " 2.1.0 " ) ,
2424 . package ( url: " https://github.com/apple/swift-container-plugin " , from: " 0.5.0 " ) ,
25+ . package ( url: " https://github.com/apple/swift-argument-parser " , from: " 1.3.0 " ) ,
2526 ] ,
2627 targets: [
2728 . executableTarget(
2829 name: " hello-world " ,
29- dependencies: [ . product( name: " Hummingbird " , package : " hummingbird " ) ] ,
30+ dependencies: [
31+ . product( name: " Hummingbird " , package : " hummingbird " ) ,
32+ . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
33+ ] ,
3034 resources: [ . process( " resources " ) ]
3135 )
3236 ]
Original file line number Diff line number Diff line change 1212//
1313//===----------------------------------------------------------------------===//
1414
15+ import ArgumentParser
16+
1517@main
16- struct Hello {
17- static let hostname = " 0.0.0.0 "
18- static let port = 8080
18+ struct Hello : AsyncParsableCommand {
19+ @Option ( name: . shortAndLong)
20+ var hostname : String = " 0.0.0.0 "
21+
22+ @Option ( name: . shortAndLong)
23+ var port : Int = 8080
1924
20- static func main ( ) async throws {
25+ func run ( ) async throws {
2126 let app = buildApplication (
2227 configuration: . init(
2328 address: . hostname( hostname, port: port) ,
You can’t perform that action at this time.
0 commit comments