File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Package
2
2
3
- version = " 1.0.2 "
3
+ version = " 1.1.0 "
4
4
author = " jiro4989"
5
5
description = " nmi display animations aimed to correct users who accidentally enter nmi instead of nim."
6
6
license = " MIT"
Original file line number Diff line number Diff line change 38
38
+@@@
39
39
"""
40
40
appName = " nmi"
41
- version = & """ { appName} command version 1.0.2
41
+ version = & """ { appName} command version 1.1.0
42
42
Copyright (c) 2020 jiro4989
43
43
Released under the MIT License.
44
44
https://github.com/jiro4989/nmi """
@@ -128,19 +128,26 @@ proc traverse(text: string, color: bool) =
128
128
cursorUp (asciiHeight - 1 )
129
129
sleep 50
130
130
131
- when isMainModule :
131
+ when isMainModule and not defined modeTest:
132
+ when not defined windows:
133
+ from posix import onSignal, SIGTERM , SIGINT
134
+ onSignal (SIGTERM , SIGINT ):
135
+ discard
136
+
132
137
let opts = commandLineParams ().getCmdOpts ()
133
138
if opts.useHelp or opts.useVersion:
134
139
quit 0
135
140
141
+ hideCursor ()
142
+ eraseScreen ()
143
+ setCursorPos (0 , 0 )
144
+ traverse (nimAscii, opts.color)
145
+
136
146
proc closeFunc () {.noconv .} =
137
147
showCursor ()
138
148
eraseScreen ()
139
149
quit 1
140
150
141
151
setControlCHook (closeFunc)
142
- hideCursor ()
143
- eraseScreen ()
144
- setCursorPos (0 , 0 )
145
- traverse (nimAscii, opts.color)
152
+
146
153
showCursor ()
You can’t perform that action at this time.
0 commit comments