Skip to content

Commit ff3ae21

Browse files
committed
implement CapabilityCommand and EnableBundleIdCapability
1 parent ee684c3 commit ff3ae21

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

Sources/AppStoreConnectCLI/AppStoreConnectCLI.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public struct AppStoreConnectCLI: ParsableCommand {
1515
ReportsCommand.self,
1616
TestFlightCommand.self,
1717
UsersCommand.self,
18+
CapabilityCommand.self
1819
])
1920

2021
public init() {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2020 Itty Bitty Apps Pty Ltd
2+
3+
import ArgumentParser
4+
5+
struct CapabilityCommand: ParsableCommand {
6+
static var configuration = CommandConfiguration(
7+
commandName: "capability",
8+
abstract: "Manage the app capabilities for a bundle ID.",
9+
subcommands: [
10+
EnableBundleIdCapabilityCommand.self
11+
]
12+
)
13+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2020 Itty Bitty Apps Pty Ltd
2+
3+
import AppStoreConnect_Swift_SDK
4+
import ArgumentParser
5+
6+
struct EnableBundleIdCapabilityCommand: CommonParsableCommand {
7+
8+
public static var configuration = CommandConfiguration(
9+
commandName: "enable",
10+
abstract: "Enable a capability for a bundle ID."
11+
)
12+
13+
@OptionGroup()
14+
var common: CommonOptions
15+
16+
@Argument(help: "The reverse-DNS bundle ID identifier to delete. Must be unique. (eg. com.example.app)")
17+
var bundleId: String
18+
19+
@Argument(help: "Bundle Id capability type. \n \(CapabilityType.allCases)")
20+
var capabilityType: CapabilityType
21+
22+
// TODO: CapabilitySetting
23+
24+
func run() throws {
25+
let service = try makeService()
26+
27+
try service.enableBundleIdCapability(
28+
bundleId: bundleId, capabilityType: capabilityType
29+
)
30+
}
31+
}

0 commit comments

Comments
 (0)