mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-12-23 03:20:44 -06:00
Compare commits
No commits in common. "be17fc6bc95f71f9284f11d4ae7fe92de4c34838" and "7e82f7ba5a24d816a79b3a5ea49f32b4c7a5ef7e" have entirely different histories.
be17fc6bc9
...
7e82f7ba5a
3 changed files with 2 additions and 27 deletions
|
@ -10,5 +10,5 @@
|
||||||
|
|
||||||
]##
|
]##
|
||||||
|
|
||||||
import hwylterm/[spin, bbansi, confirm]
|
import hwylterm/[spin, bbansi]
|
||||||
export spin, bbansi, confirm
|
export spin, bbansi
|
||||||
|
|
|
@ -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?")
|
|
4
todo.md
4
todo.md
|
@ -11,7 +11,6 @@
|
||||||
- [ ] consider reducing illwill surface to only relevant IO (input) features
|
- [ ] consider reducing illwill surface to only relevant IO (input) features
|
||||||
- [ ] revamp spinner api
|
- [ ] revamp spinner api
|
||||||
- [x] add Bbstring ~~indexing operations~~ strutils, that are span aware
|
- [x] add Bbstring ~~indexing operations~~ strutils, that are span aware
|
||||||
- [ ] add a `commands` option for `newHwylCli` in `hwylterm/cli`
|
|
||||||
|
|
||||||
## features
|
## features
|
||||||
|
|
||||||
|
@ -23,8 +22,5 @@
|
||||||
- [ ] support for rgb colors
|
- [ ] support for rgb colors
|
||||||
- [ ] modify 256 colors w/parser changes to be `"[color(9)]red"` instead of `[9]red`
|
- [ ] 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)
|
- [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 -->
|
<!-- generated with <3 by daylinmorgan/todo -->
|
||||||
|
|
Loading…
Reference in a new issue