Compare commits

..

No commits in common. "be17fc6bc95f71f9284f11d4ae7fe92de4c34838" and "7e82f7ba5a24d816a79b3a5ea49f32b4c7a5ef7e" have entirely different histories.

3 changed files with 2 additions and 27 deletions

View file

@ -10,5 +10,5 @@
]##
import hwylterm/[spin, bbansi, confirm]
export spin, bbansi, confirm
import hwylterm/[spin, bbansi]
export spin, bbansi

View file

@ -1,21 +0,0 @@
import std/[strutils]
import ./bbansi
proc confirm*(
question: string,
prefix = "",
suffix = ""
): bool =
result = false
stderr.write $(question & bb"[yellow] (Y/n) ")
while true:
let ans = readLine(stdin)
case ans.strip().toLowerAscii():
of "y","yes": return true
of "n","no": return false
else:
stderr.write($bb("[red]Please answer Yes/no\nexpected one of [b]Y,yes,N,no "))
stderr.write "\n"
when isMainModule:
echo "Response: ", confirm("Is it working?")

View file

@ -11,7 +11,6 @@
- [ ] consider reducing illwill surface to only relevant IO (input) features
- [ ] revamp spinner api
- [x] add Bbstring ~~indexing operations~~ strutils, that are span aware
- [ ] add a `commands` option for `newHwylCli` in `hwylterm/cli`
## features
@ -23,8 +22,5 @@
- [ ] support for rgb colors
- [ ] modify 256 colors w/parser changes to be `"[color(9)]red"` instead of `[9]red`
- [x] improve color detection [ref](https://github.com/Textualize/rich/blob/4101991898ee7a09fe1706daca24af5e1e054862/rich/console.py#L791)
## testing
- [ ] investigate [cap10](https://github.com/crashappsec/cap10) as a means of scripting the testing
<!-- generated with <3 by daylinmorgan/todo -->