[Midnightbsd-cvs] [MidnightBSD/src] 1586df: time: add -f format option compatible with GNU time

Lucas Holt noreply at github.com
Tue Sep 8 17:24:47 EDT 2026


  Branch: refs/heads/time-format-flag
  Home:   https://github.com/MidnightBSD/src
  Commit: 1586df01f735ba1a17bc19436910a2f4b37fe2f6
      https://github.com/MidnightBSD/src/commit/1586df01f735ba1a17bc19436910a2f4b37fe2f6
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-09-08 (Tue, 08 Sep 2026)

  Changed paths:
    M etc/mtree/BSD.tests.dist
    M usr.bin/time/Makefile
    A usr.bin/time/tests/Makefile
    A usr.bin/time/tests/time_test.sh
    M usr.bin/time/time.1
    M usr.bin/time/time.c

  Log Message:
  -----------
  time: add -f format option compatible with GNU time

Add a -f option to time(1) that prints resource usage according to a
user supplied format string.  The conversion characters follow GNU
time (%e, %E, %U, %S, %P, %M, %x, %C and friends) so that scripts
written against it on Linux work unchanged.  The averaged memory
conversions reuse the tick arithmetic already used by -l.

-f takes precedence over -h and -p; -l output still follows the
formatted line.  Document the option and every conversion in time.1,
and add a Kyua test suite covering the escapes, exit status and
signal reporting, flag precedence and -o/-a handling.

AI-Assisted-by: Claude Fable 5.1
Co-Authored-By: Claude Fable 5.1 <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3gnjjAZarNMCJKqJz7s2m
Signed-off-by: Lucas Holt <luke at foolishgames.com>



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications


More information about the Midnightbsd-cvs mailing list