Skip to content

Commit 0a47ba2

Browse files
classabbyampDuncaen
authored andcommitted
lib/format: add \e escape, fix typos in format spec, remove dbg print
1 parent e53c837 commit 0a47ba2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bin/xbps-query/xbps-query.1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,13 @@ Format strings are parsed by the following EBNF:
305305
.Bd -literal
306306
<grammar> ::= (prefix | "\\" (escape|[{}]) | substitution)*
307307
<prefix> ::= [^\\{}]+ -- Literal text chunk.
308-
<escape> ::= [abfnrtv0] -- POSIX-like espace character.
308+
<escape> ::= [abefnrtv0] -- POSIX-like escape character.
309309

310310
<substitution> ::= "{" variable ["?" default] ["!" conversion] [":" format] "}"
311311
<variable> ::= [a-zA-Z0-9_-]
312312

313-
<default> ::= ([-]?[0-9]+) -- default number.
314-
| "true" | "false" -- default boolean.
313+
<default> ::= ([-]?[0-9]+) -- default number.
314+
| "true" | "false" -- default boolean.
315315
| ('"' (("\\" (escape|'"')) | [^"])* '"') -- default string.
316316

317317
<conversion> ::= humanize | strmode | json
@@ -326,7 +326,7 @@ Format strings are parsed by the following EBNF:
326326
it using one digit.
327327
<width> ::= [0-9]+ -- Width of the output.
328328
<scale> ::= multiplier -- Minimum scale multiplier and optionally
329-
[multiplier] -- Maxium scale multiplier.
329+
[multiplier] -- Maximum scale multiplier.
330330
<multiplier> ::= "B" -- byte
331331
| "K" -- kilo
332332
| "M" -- mega
@@ -347,7 +347,7 @@ Format strings are parsed by the following EBNF:
347347
<sign> ::= "+" -- Add sign to positive and negative numbers.
348348
| "-" -- Add sign to negative numbers.
349349
<width> ::= [0-9]+ -- The alignment width.
350-
<precision> ::= [0-9]+ -- Percision for numbers.
350+
<precision> ::= [0-9]+ -- Precision for numbers.
351351
<type> ::= "d" -- Decimal number.
352352
| "o" -- Octal number.
353353
| "u" -- Unsigned number.

lib/format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ nexttok(enum tok *tok, const char **pos, struct strbuf *buf)
131131
case '\\': r = strbuf_putc(buf, '\\'); break;
132132
case 'a': r = strbuf_putc(buf, '\a'); break;
133133
case 'b': r = strbuf_putc(buf, '\b'); break;
134+
case 'e': r = strbuf_putc(buf, '\e'); break;
134135
case 'f': r = strbuf_putc(buf, '\f'); break;
135136
case 'n': r = strbuf_putc(buf, '\n'); break;
136137
case 'r': r = strbuf_putc(buf, '\r'); break;
@@ -553,7 +554,6 @@ xbps_fmt_parse(const char *format)
553554
if (r < 0)
554555
goto err;
555556
}
556-
fprintf(stderr, "fmt: prefix='%s' var='%s'\n", fmt[n].prefix, fmt[n].var);
557557
n++;
558558
}
559559
out:

0 commit comments

Comments
 (0)