util  Check-in [4af59f8377]

Overview
Comment:fix usage error
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4af59f83775d208a96ce58de62bfe9a8c6edd340862d5ee29d79a13c70829ffb
User & Date: lexi on 2019-07-19 20:50:31
Other Links: manifest | tags
Context
2019-07-20
18:12
fixes check-in: 00358989c7 user: lexi tags: trunk
2019-07-19
20:50
fix usage error check-in: 4af59f8377 user: lexi tags: trunk
12:07
fxi ubgs check-in: 8ce91f9627 user: lexi tags: trunk
Changes

Modified ord.c from [c509ad7fa4] to [c1a75e9d61].

268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
...
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
#	endif
#	define OR "\x1b[34m|\x1b[93m" 
#	define plus "\x1b[94m+\x1b[m"
#	define par(s) "<\x1b[4m" s "\x1b[24m>"
#	define lit(l) "\x1b[3m" l "\x1b[23m"
#	define box(s) "\x1b[94m[\x1b[93m" s "\x1b[94m]\x1b[m"
		const pstr forms[] = {
			p(box(box("options") " " par("in:spec")) " " par("value:int") plus " "
					box(lit("to") " " box(par("out:spec")))),
			p(box(box("options") " " par("in:spec")) " " box(lit("to") " " box(par("out:spec")))
					" " lit("--") " " par("value:int") plus),
		}, specs[] = {
			p(box(lit("bin") OR lit("tern") OR lit("oct")
					OR lit("dec") OR lit("hex") OR
					lit("base") " " box("0-9") plus OR "asc")),
		}, ints[] = {
			p("default base: \x1b[94m.+\x1b[m"),
................................................................................
			p("-m --manual-prefix: specify a manual prefix to print before each number"),
			p("-l --lowercase    : prefer lowercase for case-insensitive bases"),
		};
#	undef p
#	undef OR
#	undef plus

#	define hl_on  "\x1b[1m" 
#	define hl_off "\x1b[21m"
	enum { ansilen = sizeof (hl_on hl_off) };
#	define hl(x) (hl_on x hl_off)
		const char form_head []= hl("usage: ");
		const char spec_head []= hl("- spec: ");
		const char int_head  []= hl("- int: ");
		const char opt_head  []= hl("- options: ");
		const char space     []=    "           "; /* sigh */







|

|







 







|
|







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
...
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
#	endif
#	define OR "\x1b[34m|\x1b[93m" 
#	define plus "\x1b[94m+\x1b[m"
#	define par(s) "<\x1b[4m" s "\x1b[24m>"
#	define lit(l) "\x1b[3m" l "\x1b[23m"
#	define box(s) "\x1b[94m[\x1b[93m" s "\x1b[94m]\x1b[m"
		const pstr forms[] = {
			p(box("options") " " box(par("in:spec")) " " par("value:int") plus " "
					box(lit("to") " " box(par("out:spec")))),
			p(box("options") " " box(par("in:spec")) " " box(lit("to") " " box(par("out:spec")))
					" " lit("--") " " par("value:int") plus),
		}, specs[] = {
			p(box(lit("bin") OR lit("tern") OR lit("oct")
					OR lit("dec") OR lit("hex") OR
					lit("base") " " box("0-9") plus OR "asc")),
		}, ints[] = {
			p("default base: \x1b[94m.+\x1b[m"),
................................................................................
			p("-m --manual-prefix: specify a manual prefix to print before each number"),
			p("-l --lowercase    : prefer lowercase for case-insensitive bases"),
		};
#	undef p
#	undef OR
#	undef plus

#	define hl_on  "\x1b[;1m" 
#	define hl_off "\x1b[m"
	enum { ansilen = sizeof (hl_on hl_off) };
#	define hl(x) (hl_on x hl_off)
		const char form_head []= hl("usage: ");
		const char spec_head []= hl("- spec: ");
		const char int_head  []= hl("- int: ");
		const char opt_head  []= hl("- options: ");
		const char space     []=    "           "; /* sigh */