mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Refactor the new 'times' builtin; zero-pad seconds (re: 65d363fd
)
The output format is now identical to mksh's except for
the locale-dependent radix point ('.' or ',').
src/cmd/ksh93/bltins/misc.c:
- Output format tweak: pad seconds with initial zero if < 10.
- Use "too many operands" (e_toomanyops) error msg from 3ba4900e
if there are operands, instead of "bad syntax" (e_badsyntax).
- Consolidate repetitive calculating and printing code
into print_times().
- Get rid of some excessive variables.
src/cmd/ksh93/tests/builtins.sh:
- Update regression tests to match the above.
src/cmd/ksh93/data/builtins.c:
- Update sh_opttimes[] version string.
This commit is contained in:
parent
57ff4676eb
commit
5c677a4c6c
3 changed files with 22 additions and 43 deletions
|
@ -1836,7 +1836,7 @@ USAGE_LICENSE
|
|||
;
|
||||
|
||||
const char sh_opttimes[] =
|
||||
"[-1c?@(#)$Id: times (ksh93) 2020-06-06 $\n]"
|
||||
"[-1c?@(#)$Id: times (ksh93) 2020-06-24 $\n]"
|
||||
"[+NAME?times - display CPU usage by the shell and child processes]"
|
||||
"[+DESCRIPTION?\btimes\b displays the accumulated user and system CPU times, "
|
||||
"one line with the times used by the shell and another with those used by "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue