Skip to content

Commit cecac85

Browse files
committed
[CPFeature-008] Changed the CPFileHandler to be the CPInterface Implementation . Renamed it to CommitPrefix
1 parent 2f3cee1 commit cecac85

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Sources/CommitPrefix/CPInterfaceImpl.swift

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// CPFileHandler.swift
2+
// CPInterfaceImpl.swift
33
// commitPrefix
44
//
55
// MIT License
@@ -25,13 +25,15 @@
2525
// SOFTWARE.
2626

2727
import Consler
28-
import Foundation
2928
import Files
29+
import Foundation
3030

31-
struct CommitPrefix: CPInterface {
31+
struct CommitPrefix {
3232

3333
private init() {}
3434

35+
static func interface() -> CPInterface { CommitPrefix() }
36+
3537
private func getInteractor() throws -> CPInteractor {
3638
guard Folder.current.containsSubfolder(named: FolderName.git) else {
3739
throw CPError.notAGitRepo(currentLocation: Folder.current.path)
@@ -42,13 +44,22 @@ struct CommitPrefix: CPInterface {
4244
return cpInteractor
4345
}
4446

45-
public static func interface() -> CPInterface { CommitPrefix() }
47+
}
48+
49+
// MARK: - CPInterface Conformances
50+
extension CommitPrefix: CPInterface {
4651

4752
func outputPrefixes() throws -> ConslerOutput {
4853
let cpInteractor = try getInteractor()
4954
return try cpInteractor.outputPrefixes()
5055
}
5156

57+
func outputVersion() -> ConslerOutput {
58+
return ConslerOutput(
59+
"CommitPrefix ", "version ", CPInfo.version)
60+
.describedBy(.normal, .cyan, .cyan)
61+
}
62+
5263
func viewState() throws -> ConslerOutput {
5364
let cpInteractor = try getInteractor()
5465
let cpState = try cpInteractor.getCommitPrefixState()

0 commit comments

Comments
 (0)