xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Sources / XToolSupport / DSCommands / DSCommand.swift
DSCommand.swift34 lines · 977 BRaw
| 1 | import Foundation |
| 2 | import XKit |
| 3 | import ArgumentParser |
| 4 | import Dependencies |
| 5 | |
| 6 | struct DSAnisetteCommand: AsyncParsableCommand { |
| 7 | static let configuration = CommandConfiguration( |
| 8 | commandName: "anisette", |
| 9 | abstract: "Test out Anisette data" |
| 10 | ) |
| 11 | |
| 12 | func run() async throws { |
| 13 | @Dependency(\.anisetteDataProvider) var provider |
| 14 | let res = try await provider.fetchAnisetteData() |
| 15 | for (key, value) in res.dictionary.sorted(by: { $0.key < $1.key }) { |
| 16 | print("\(key): \(value)") |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | struct DSCommand: AsyncParsableCommand { |
| 22 | static let configuration = CommandConfiguration( |
| 23 | commandName: "ds", |
| 24 | abstract: "Interact with Apple Developer Services", |
| 25 | subcommands: [ |
| 26 | DSTeamsCommand.self, |
| 27 | DSCertificatesCommand.self, |
| 28 | DSIdentifiersCommand.self, |
| 29 | DSDevicesCommand.self, |
| 30 | DSProfilesCommand.self, |
| 31 | DSAnisetteCommand.self, |
| 32 | ] |
| 33 | ) |
| 34 | } |