diff --git a/README.md b/README.md index e214fd6..1903b3a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ dependencies: [ let sqliteURL = FileManager() .homeDirectoryForCurrentUser .appending(path: "file.sqlite") -var cli = CLIKitService(help: "サンプルCLI") +var cli = CLI(help: "サンプルCLI") cli.use(AddCommand(), as: "add") cli.use(CommitCommand(), as: "commit") cli.migrations.add(CommitMigration()) diff --git a/Sources/CLIKit/CLIKit.swift b/Sources/CLIKit/CLIKit.swift index 38d927f..0e51309 100644 --- a/Sources/CLIKit/CLIKit.swift +++ b/Sources/CLIKit/CLIKit.swift @@ -11,13 +11,13 @@ import Logging /// let sqliteURL = FileManager() /// .homeDirectoryForCurrentUser /// .appending(path: "file.sqlite") -/// var cli = CLIKitService(help: "サンプルCLI") +/// var cli = CLI(help: "サンプルCLI") /// cli.use(AddCommand(), as: "add") /// cli.use(CommitCommand(), as: "commit") /// cli.migrations.add(CommitMigration()) /// await cli.run() /// ``` -public struct CLIKitService: Sendable { +public struct CLI: Sendable { public var help: String public var console: any Console public var input: CommandInput diff --git a/Sources/CLIKit/CommandContext+initDatabase.swift b/Sources/CLIKit/CommandContext+initDatabase.swift index ae7e2b3..6cf32c0 100644 --- a/Sources/CLIKit/CommandContext+initDatabase.swift +++ b/Sources/CLIKit/CommandContext+initDatabase.swift @@ -17,7 +17,7 @@ extension CommandContext { let databases = await storage.get(Databases.self), let db = await databases.database(logger: logger, on: eventLoopGroup.any()) else { - fatalError("データベースが初期化されていません。CLIKitService(sqlitePath: \"...\")で初期化してください") + fatalError("データベースが初期化されていません。CLI(sqlitePath: \"...\")で初期化してください") } return db } diff --git a/Tests/CLIKitTests/CLIKitDatabaseTests.swift b/Tests/CLIKitTests/CLIKitDatabaseTests.swift index b981e26..724e76f 100644 --- a/Tests/CLIKitTests/CLIKitDatabaseTests.swift +++ b/Tests/CLIKitTests/CLIKitDatabaseTests.swift @@ -39,7 +39,7 @@ import Testing } removeSQLiteFile() defer { removeSQLiteFile() } - var sut = CLIKitService( + var sut = CLI( console: console, input: CommandInput(arguments: ["cli", "save"]), sqliteURL: sqliteURL diff --git a/Tests/CLIKitTests/CLIKitServiceTests.swift b/Tests/CLIKitTests/CLIKitServiceTests.swift index 1bf4733..072c536 100644 --- a/Tests/CLIKitTests/CLIKitServiceTests.swift +++ b/Tests/CLIKitTests/CLIKitServiceTests.swift @@ -2,7 +2,7 @@ import CLIKit import ConsoleKit import Testing -@Suite struct CLIKitServiceTests { +@Suite struct CLITests { @Test func サンプル() async throws { // Arrange struct TestCommand: AsyncCommand { @@ -17,7 +17,7 @@ import Testing } let console = TestConsole() - var sut = CLIKitService( + var sut = CLI( console: console, input: CommandInput(arguments: ["git", "commit", "-m", "hello"]) )