From ff820fdf220900dc092103501d98587deb0fbb53 Mon Sep 17 00:00:00 2001 From: Underthestars-zhy Date: Sat, 3 Jun 2023 23:30:28 +0800 Subject: [PATCH] bug fix --- README.md | 2 +- SwiftGGFormatter.xcodeproj/project.pbxproj | 8 ++++---- SwiftGGFormatter/{main.swift => SwiftGGFormatter.swift} | 9 +++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) rename SwiftGGFormatter/{main.swift => SwiftGGFormatter.swift} (61%) diff --git a/README.md b/README.md index dc57705..ed1f7b1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ SwiftGGFormatter is a tool that can reformat SwiftGG's YAML file, arranging its ## Installation 1. Please visit the release page and download the latest version of the CLI. -2. Move the downloaded CLI to the `/usr/bin/` directory. +2. Move the downloaded CLI to the `/usr/local/bin/` directory. ## Get Started diff --git a/SwiftGGFormatter.xcodeproj/project.pbxproj b/SwiftGGFormatter.xcodeproj/project.pbxproj index 9b1861b..902abd9 100644 --- a/SwiftGGFormatter.xcodeproj/project.pbxproj +++ b/SwiftGGFormatter.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 90B11FF32A2B8CDA00188D29 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90B11FF22A2B8CDA00188D29 /* main.swift */; }; + 90B11FF32A2B8CDA00188D29 /* SwiftGGFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90B11FF22A2B8CDA00188D29 /* SwiftGGFormatter.swift */; }; 90B11FFB2A2B8CFA00188D29 /* SwiftGGFormater in Frameworks */ = {isa = PBXBuildFile; productRef = 90B11FFA2A2B8CFA00188D29 /* SwiftGGFormater */; }; 90B11FFD2A2B8D0600188D29 /* Mapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90B11FFC2A2B8D0600188D29 /* Mapper.swift */; }; 90B120002A2B8EB200188D29 /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = 90B11FFF2A2B8EB200188D29 /* ArgumentParser */; }; @@ -27,7 +27,7 @@ /* Begin PBXFileReference section */ 90B11FEF2A2B8CDA00188D29 /* SwiftGGFormatter */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SwiftGGFormatter; sourceTree = BUILT_PRODUCTS_DIR; }; - 90B11FF22A2B8CDA00188D29 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 90B11FF22A2B8CDA00188D29 /* SwiftGGFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftGGFormatter.swift; sourceTree = ""; }; 90B11FFC2A2B8D0600188D29 /* Mapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mapper.swift; sourceTree = ""; }; 90B120012A2B903F00188D29 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; /* End PBXFileReference section */ @@ -65,7 +65,7 @@ 90B11FF12A2B8CDA00188D29 /* SwiftGGFormatter */ = { isa = PBXGroup; children = ( - 90B11FF22A2B8CDA00188D29 /* main.swift */, + 90B11FF22A2B8CDA00188D29 /* SwiftGGFormatter.swift */, 90B11FFC2A2B8D0600188D29 /* Mapper.swift */, ); path = SwiftGGFormatter; @@ -138,7 +138,7 @@ buildActionMask = 2147483647; files = ( 90B11FFD2A2B8D0600188D29 /* Mapper.swift in Sources */, - 90B11FF32A2B8CDA00188D29 /* main.swift in Sources */, + 90B11FF32A2B8CDA00188D29 /* SwiftGGFormatter.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SwiftGGFormatter/main.swift b/SwiftGGFormatter/SwiftGGFormatter.swift similarity index 61% rename from SwiftGGFormatter/main.swift rename to SwiftGGFormatter/SwiftGGFormatter.swift index da8c740..a5cdb07 100644 --- a/SwiftGGFormatter/main.swift +++ b/SwiftGGFormatter/SwiftGGFormatter.swift @@ -9,8 +9,13 @@ import Foundation import SwiftGGFormater import ArgumentParser -struct SwiftGGFormatterCLI: ParsableCommand { - @Argument(help: "TPlease provide the file path of the text you want to reorder.") +@main +struct SwiftGGFormatterCLI: AsyncParsableCommand { + static var configuration: CommandConfiguration { + .init(commandName: "SwiftGGFormatter") + } + + @Argument(help: "Please provide the file path of the text you want to reorder.") var path: String mutating func run() async throws {