Skip to content

Commit 1e36d12

Browse files
committed
FIX: revisited color attributes in ANSI escape codes on Windows so it is more consistent with POSIX terminals now.
1 parent 2f8ae52 commit 1e36d12

File tree

2 files changed

+165
-112
lines changed

2 files changed

+165
-112
lines changed

src/mezz/mezz-help.r

+72-73
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ dump-obj: function [
7575
]
7676
]
7777
][
78-
str: join "^[[1;32;49m" form-pad word 15
79-
append str "^[[0m "
78+
str: join "^[[1;32m" form-pad word 15
79+
append str "^[[m "
8080
append str form-pad type 24 - ((length? str) - 15)
8181
append out reform [
8282
" " str "^[[32m"
8383
if type <> 'unset! [form-val :val]
84-
"^[[0m^/"
84+
"^[[m^/"
8585
]
8686
]
8787
]
@@ -96,45 +96,45 @@ dump-obj: function [
9696
][
9797
if unset? get/any 'word [
9898
print trim/auto {
99-
Use ^[[1;32;49mHELP^[[0m or ^[[1;32;49m?^[[0m to see built-in info:
100-
^[[1;32;49m
99+
Use ^[[1;32mHELP^[[m or ^[[1;32m?^[[m to see built-in info:
100+
^[[1;32m
101101
help insert
102102
? insert
103-
^[[0m
103+
^[[m
104104
To search within the system, use quotes:
105-
^[[1;32;49m
105+
^[[1;32m
106106
? "insert"
107-
^[[0m
107+
^[[m
108108
To browse online web documents:
109-
^[[1;32;49m
109+
^[[1;32m
110110
help/doc insert
111-
^[[0m
111+
^[[m
112112
To view words and values of a context or object:
113113
114-
^[[1;32;49m? lib^[[0m - the runtime library
115-
^[[1;32;49m? self^[[0m - your user context
116-
^[[1;32;49m? system^[[0m - the system object
117-
^[[1;32;49m? system/options^[[0m - special settings
114+
^[[1;32m? lib^[[m - the runtime library
115+
^[[1;32m? self^[[m - your user context
116+
^[[1;32m? system^[[m - the system object
117+
^[[1;32m? system/options^[[m - special settings
118118
119119
To see all words of a specific datatype:
120-
^[[1;32;49m
120+
^[[1;32m
121121
? native!
122122
? function!
123123
? datatype!
124-
^[[0m
124+
^[[m
125125
Other debug functions:
126126
127-
^[[1;32;49m??^[[0m - display a variable and its value
128-
^[[1;32;49mprobe^[[0m - print a value (molded)
129-
^[[1;32;49msource^[[0m - show source code of func
130-
^[[1;32;49mtrace^[[0m - trace evaluation steps
131-
^[[1;32;49mwhat^[[0m - show a list of known functions
127+
^[[1;32m??^[[m - display a variable and its value
128+
^[[1;32mprobe^[[m - print a value (molded)
129+
^[[1;32msource^[[m - show source code of func
130+
^[[1;32mtrace^[[m - trace evaluation steps
131+
^[[1;32mwhat^[[m - show a list of known functions
132132
133133
Other information:
134134
135-
^[[1;32;49mabout^[[0m - see general product info
136-
^[[1;32;49mlicense^[[0m - show user license
137-
^[[1;32;49musage^[[0m - program cmd line options
135+
^[[1;32mabout^[[m - see general product info
136+
^[[1;32mlicense^[[m - show user license
137+
^[[1;32musage^[[m - program cmd line options
138138
}
139139
exit
140140
]
@@ -194,23 +194,23 @@ dump-obj: function [
194194
if all [word? :word datatype? get :word] [
195195
value: spec-of get :word
196196
print ajoin [
197-
"^[[1;32;49m" mold :word "^[[0m is a datatype" newline
197+
"^[[1;32m" mold :word "^[[m is a datatype" newline
198198
"It is defined as " either find "aeiou" first value/title ["an "] ["a "] value/title newline
199-
"It is of the general type ^[[1;32;49m" value/type "^[[0m^/"
199+
"It is of the general type ^[[1;32m" value/type "^[[m^/"
200200
]
201201
]
202202
if any [:word = 'unset! not value? :word] [exit]
203203
types: dump-obj/match lib :word
204204
sort types
205205
if not empty? types [
206-
print ["Found these related words:^[[32m" newline types "^[[0m"]
206+
print ["Found these related words:^[[32m" newline types "^[[m"]
207207
exit
208208
]
209209
if all [word? :word datatype? get :word] [
210-
print ["No values defined for^[[1;32;49m" word "^[[0m"]
210+
print ["No values defined for^[[1;32m" word "^[[m"]
211211
exit
212212
]
213-
print ["No information on^[[1;32;49m" word "^[[0m"]
213+
print ["No information on^[[1;32m" word "^[[m"]
214214
exit
215215
]
216216

@@ -223,7 +223,7 @@ dump-obj: function [
223223

224224
; Print literal values:
225225
if not any [word? :word path? :word][
226-
print ajoin ["^[[1;32;49m" mold :word "^[[0m is " type-name :word]
226+
print ajoin ["^[[1;32m" mold :word "^[[m is " type-name :word]
227227
exit
228228
]
229229

@@ -250,9 +250,9 @@ dump-obj: function [
250250
value: get :word
251251
]
252252
unless any-function? :value [
253-
prin ajoin ["^[[1;32;49m" uppercase mold word "^[[0m is " type-name :value " of value: ^[[32m"]
253+
prin ajoin ["^[[1;32m" uppercase mold word "^[[m is " type-name :value " of value: ^[[32m"]
254254
prin either any [object? value port? value] [print "" dump-obj value][mold/all :value]
255-
print "^[[0m"
255+
print "^[[m"
256256
exit
257257
]
258258

@@ -261,7 +261,7 @@ dump-obj: function [
261261
;if path? :word [word: first :word]
262262

263263
;-- Print info about function:
264-
prin "USAGE:^/^-"
264+
prin "^[[4;1;36mUSAGE^[[m:^/^-"
265265

266266
args: words-of :value
267267
clear find args /local
@@ -272,7 +272,7 @@ dump-obj: function [
272272
]
273273

274274
print ajoin [
275-
newline "DESCRIPTION:" newline
275+
newline "^[[4;1;36mDESCRIPTION^[[m:" newline
276276
tab any [title-of :value "(undocumented)"] newline
277277
tab uppercase mold word " is " type-name :value " value."
278278
]
@@ -309,8 +309,8 @@ dump-obj: function [
309309
]
310310
]
311311

312-
print-args "^/ARGUMENTS:" argl
313-
print-args/extra "^/REFINEMENTS:" refl
312+
print-args "^/^[[4;1;36mARGUMENTS^[[m:" argl
313+
print-args/extra "^/^[[4;1;36mREFINEMENTS^[[m:" refl
314314
]
315315

316316
exit ; return unset
@@ -327,43 +327,42 @@ about: func [
327327
usage: func [
328328
"Prints command-line arguments."
329329
][
330-
print trim/auto {
331-
Command line usage:
332-
333-
REBOL |options| |script| |arguments|
334-
335-
Standard options:
336-
337-
--args data Explicit arguments to script (quoted)
338-
--do expr Evaluate expression (quoted)
339-
--help (-?) Display this usage information
340-
--script file Explicit script filename
341-
--version tuple Script must be this version or greater
342-
343-
Special options:
344-
345-
--boot level Valid levels: base sys mods
346-
--debug flags For user scripts (system/options/debug)
347-
--halt (-h) Leave console open when script is done
348-
--import file Import a module prior to script
349-
--quiet (-q) No startup banners or information
350-
--secure policy Can be: none allow ask throw quit
351-
--trace (-t) Enable trace mode during boot
352-
--verbose Show detailed startup information
353-
354-
Other quick options:
355-
356-
-s No security
357-
+s Full security
358-
-v Display version only (then quit)
359-
360-
Examples:
361-
362-
REBOL script.r
363-
REBOL -s script.r
364-
REBOL script.r 10:30 test@example.com
365-
REBOL --do "watch: on" script.r
366-
}
330+
print {
331+
^[[4;1;36mCommand line usage^[[m:
332+
333+
^[[1;32mREBOL |options| |script| |arguments|^[[m
334+
335+
^[[4;1;36mStandard options^[[m:
336+
337+
^[[1;32m--args data^[[m Explicit arguments to script (quoted)
338+
^[[1;32m--do expr^[[m Evaluate expression (quoted)
339+
^[[1;32m--help (-?)^[[m Display this usage information
340+
^[[1;32m--script file^[[m Explicit script filename
341+
^[[1;32m--version tuple^[[m Script must be this version or greater
342+
343+
^[[4;1;36mSpecial options^[[m:
344+
345+
^[[1;32m--boot level^[[m Valid levels: base sys mods
346+
^[[1;32m--debug flags^[[m For user scripts (system/options/debug)
347+
^[[1;32m--halt (-h)^[[m Leave console open when script is done
348+
^[[1;32m--import file^[[m Import a module prior to script
349+
^[[1;32m--quiet (-q)^[[m No startup banners or information
350+
^[[1;32m--secure policy^[[m Can be: none allow ask throw quit
351+
^[[1;32m--trace (-t)^[[m Enable trace mode during boot
352+
^[[1;32m--verbose^[[m Show detailed startup information
353+
354+
^[[4;1;36mOther quick options^[[m:
355+
356+
^[[1;32m-s^[[m No security
357+
^[[1;32m+s^[[m Full security
358+
^[[1;32m-v^[[m Display version only (then quit)
359+
360+
^[[4;1;36mExamples^[[m:
361+
362+
REBOL script.r
363+
REBOL -s script.r
364+
REBOL script.r 10:30 test@example.com
365+
REBOL --do "watch: on" script.r}
367366
]
368367

369368
license: func [

0 commit comments

Comments
 (0)