-
Notifications
You must be signed in to change notification settings - Fork 21
/
spinners-examples.elv
38 lines (29 loc) · 1.01 KB
/
spinners-examples.elv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use github.com/zzamboni/elvish-modules/spinners
spinners:run { sleep 3 }
spinners:run &spinner=arrow &title="Loading modules" { sleep 3 }
spinners:run &title=(styled "Counting files" blue) &style=green { fd . . } | count
fd . . | spinners:run &title="Counting characters in filenames" { each [f]{ all $f } } | count
spinners:run &title="Starting title" &persist=$true [s]{
sleep 3
spinners:attr $s title "New title!"
sleep 3
spinners:attr $s spinner shark
spinners:attr $s style [ red ]
sleep 3
spinners:attr $s persist success
}
spinners:persist-symbols[unicorn] = [ &symbol="🦄" &color=default ]
spinners:run &title="Getting a unicorn" &persist=unicorn { sleep 3 }
s = (spinners:new &title="Test spinner" &persist=status &hide-exception)
spinners:start $s
sleep 3
spinners:attr $s title "New title!"
sleep 2
spinners:persist $s
sleep 1
spinners:attr $s spinner shark
sleep 3
spinners:attr $s status ?(fail error)
spinners:persist-and-new $s &indent=2 &title=(styled "Next step" blue)
sleep 3
spinners:stop $s