Skip to content

Commit

Permalink
TunesCommand is now part of the library (#562)
Browse files Browse the repository at this point in the history
this way the bundled app can call any of the sub commands in the future.

the go() is to workaround
apple/swift-argument-parser#688
  • Loading branch information
bolsinga authored Dec 23, 2024
1 parent 8a9ef23 commit 623313a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import ArgumentParser
import Foundation
import iTunes

@main
public struct Program: AsyncParsableCommand {
public struct TunesCommand: AsyncParsableCommand {
public static let configuration = CommandConfiguration(
commandName: "tunes",
abstract: "A tool for working with iTunes data.",
Expand All @@ -13,4 +11,8 @@ public struct Program: AsyncParsableCommand {
)

public init() {} // This is public and empty to help the compiler.

public static func go(_ arguments: [String]?) async {
await Self.main(arguments)
}
}
10 changes: 10 additions & 0 deletions Sources/tunes/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// main.swift
// iTunesJson
//
// Created by Greg Bolsinga on 12/22/24.
//

import iTunes

await TunesCommand.go(CommandLine.arguments)

0 comments on commit 623313a

Please sign in to comment.