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