INNER CODE UNIT · Swift

performCommand

apple/swift-argument-parser · Plugins/GenerateCommon/GeneratePlugin.swift:26

  func performCommand(
    context: PluginContext,
    arguments: [String]
  ) async throws {
    // Locate generation tool.
    let generationTool = Self.executableName
    let generationToolFile = try context.tool(named: generationTool).url

    // Create an extractor to extract plugin-only arguments from the `arguments`
    // array.
    var extractor = ArgumentExtractor(arguments)

    // Run generation tool once if help is requested.
    if extractor.helpRequest() {
      try generationToolFile.exec(arguments: ["--help"])
      print(
        """
        ADDITIONAL OPTIONS:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…