Skip to content

Commit

Permalink
feat: Simple tty compatible spinner (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
WatskeBart authored Jan 9, 2025
1 parent 5dd4641 commit 4052967
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/ActivityIndicator+CommandArgument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum ActivityIndicatorStyle: String, CaseIterable, ExpressibleByArgument {
case dots
case kitt
case snake
case spinner
}

extension ActivityIndicator {
Expand All @@ -15,6 +16,8 @@ extension ActivityIndicator {
.kitt
case .snake:
.snake
case .spinner:
.spinner
}
}
}
13 changes: 13 additions & 0 deletions Sources/ActivityIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ extension ActivityIndicator {
)
return ActivityIndicator(configuration: configuration)
}()

static let spinner: ActivityIndicator = {
let configuration = Configuration(
refreshRate: 125,
states: [
"\\",
"|",
"/",
"-",
]
)
return ActivityIndicator(configuration: configuration)
}()
}

#if DEBUG
Expand Down

0 comments on commit 4052967

Please sign in to comment.