Skip to content

Commit bc43563

Browse files
committed
lib/format: add \e escape, fix typos in format spec, remove dbg print
1 parent 02f7bcd commit bc43563

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

bin/xbps-query/xbps-query.1

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

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

311-
<default> ::= ([-]?[0-9]+) -- default number.
312-
| "true" | "false" -- default boolean.
311+
<default> ::= ([-]?[0-9]+) -- default number.
312+
| "true" | "false" -- default boolean.
313313
| ('"' (("\\" (escape|'"')) | [^"])* '"') -- default string.
314314

315315
<conversion> ::= humanize | strmode
@@ -324,7 +324,7 @@ Format strings are parsed by the following EBNF:
324324
it using one digit.
325325
<width> ::= [0-9]+ -- Width of the output.
326326
<scale> ::= multiplier -- Minimum scale multiplier and optionally
327-
[multiplier] -- Maxium scale multiplier.
327+
[multiplier] -- Maximum scale multiplier.
328328
<multiplier> ::= "B" -- byte
329329
| "K" -- kilo
330330
| "M" -- mega
@@ -342,7 +342,7 @@ Format strings are parsed by the following EBNF:
342342
<sign> ::= "+" -- Add sign to positive and negative numbers.
343343
| "-" -- Add sign to negative numbers.
344344
<width> ::= [0-9]+ -- The alignment width.
345-
<precision> ::= [0-9]+ -- Percision for numbers.
345+
<precision> ::= [0-9]+ -- Precision for numbers.
346346
<type> ::= "d" -- Decimal number.
347347
| "o" -- Octal number.
348348
| "u" -- Unsigned number.

lib/format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ nexttok(const char **pos, struct strbuf *buf)
128128
case '\\': r = strbuf_putc(buf, '\\'); break;
129129
case 'a': r = strbuf_putc(buf, '\a'); break;
130130
case 'b': r = strbuf_putc(buf, '\b'); break;
131+
case 'e': r = strbuf_putc(buf, '\e'); break;
131132
case 'f': r = strbuf_putc(buf, '\f'); break;
132133
case 'n': r = strbuf_putc(buf, '\n'); break;
133134
case 'r': r = strbuf_putc(buf, '\r'); break;
@@ -540,7 +541,6 @@ xbps_fmt_parse(const char *format)
540541
if (r < 0)
541542
goto err;
542543
}
543-
fprintf(stderr, "fmt: prefix='%s' var='%s'\n", fmt[n].prefix, fmt[n].var);
544544
n++;
545545
}
546546
out:

0 commit comments

Comments
 (0)