Skip to content

Commit 4052967

Browse files
authored
feat: Simple tty compatible spinner (#8)
1 parent 5dd4641 commit 4052967

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Sources/ActivityIndicator+CommandArgument.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ enum ActivityIndicatorStyle: String, CaseIterable, ExpressibleByArgument {
44
case dots
55
case kitt
66
case snake
7+
case spinner
78
}
89

910
extension ActivityIndicator {
@@ -15,6 +16,8 @@ extension ActivityIndicator {
1516
.kitt
1617
case .snake:
1718
.snake
19+
case .spinner:
20+
.spinner
1821
}
1922
}
2023
}

Sources/ActivityIndicator.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ extension ActivityIndicator {
7676
)
7777
return ActivityIndicator(configuration: configuration)
7878
}()
79+
80+
static let spinner: ActivityIndicator = {
81+
let configuration = Configuration(
82+
refreshRate: 125,
83+
states: [
84+
"\\",
85+
"|",
86+
"/",
87+
"-",
88+
]
89+
)
90+
return ActivityIndicator(configuration: configuration)
91+
}()
7992
}
8093

8194
#if DEBUG

0 commit comments

Comments
 (0)