File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11//
2- // CPFileHandler .swift
2+ // CPInterfaceImpl .swift
33// commitPrefix
44//
55// MIT License
2525// SOFTWARE.
2626
2727import Consler
28- import Foundation
2928import 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 ( )
You can’t perform that action at this time.
0 commit comments