Bug 242686 - procstat usage message is mangled
Summary: procstat usage message is mangled
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Phil Shafer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-17 16:00 UTC by Mark Johnston
Modified: 2020-01-25 21:22 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer 2019-12-17 16:00:00 UTC
The descriptions of the subcommands are wildly misformatted.  This seems to be the result of a change in libxo: procstat writes the usage message incrementally using xo_error(), and libxo recently changed xo_error() to append a newline if the input string does not end with one.

We can fix procstat, but xo_error()'s behaviour contradicts its man page:

     When converting an application to libxo, one can replace
     fprintf(stderr,...) calls with xo_error() calls.

I don't really understand why xo_error() is doing this given that we have xo_err(), xo_errx(), etc..
Comment 1 Phil Shafer freebsd_committer 2019-12-17 19:19:30 UTC
This is a fix of a bug (test for newline was broken) but you are correct that it's a behavior change.  I'll revert and add a new function with the new behavior.

Thanks,
 Phil
Comment 2 commit-hook freebsd_committer 2020-01-25 21:17:13 UTC
A commit references this bug:

Author: phil
Date: Sat Jan 25 21:16:50 UTC 2020
New revision: 357125
URL: https://svnweb.freebsd.org/changeset/base/357125

Log:
  Import libxo-1.4.0:

      - Two changes to encoder options:
          encoder options may use plus or colon, but only one
          encoder names can be specified as "@name"
          This results in the syntax:

          df --libxo @csv:no-header:leafs=name.available-blocks /

      - If xo_set_program is called before xo_parse_args, honor the requested value
      - add xo_errorn* function; repair newline-adding-on-xo_error bug
      - test programs now use fixed name, since linux libtool prefixs "lt-"
      - Fix "horse butt" comment in source code
      - update test cases

  PR:		242686

Changes:
_U  head/contrib/libxo/
  head/contrib/libxo/configure.ac
  head/contrib/libxo/doc/api.rst
  head/contrib/libxo/doc/encoders.rst
  head/contrib/libxo/doc/options.rst
  head/contrib/libxo/encoder/csv/enc_csv.c
  head/contrib/libxo/libxo/libxo.c
  head/contrib/libxo/libxo/xo.h
  head/contrib/libxo/libxo/xo_encoder.c
  head/contrib/libxo/libxo/xo_encoder.h
  head/contrib/libxo/tests/core/Makefile.am
  head/contrib/libxo/tests/core/saved/test_02.H.out
  head/contrib/libxo/tests/core/saved/test_02.HIPx.out
  head/contrib/libxo/tests/core/saved/test_02.HP.out
  head/contrib/libxo/tests/core/saved/test_02.J.out
  head/contrib/libxo/tests/core/saved/test_02.JP.out
  head/contrib/libxo/tests/core/saved/test_02.T.err
  head/contrib/libxo/tests/core/saved/test_02.X.out
  head/contrib/libxo/tests/core/saved/test_02.XP.out
  head/contrib/libxo/tests/core/test_02.c
  head/contrib/libxo/tests/core/test_12.c
  head/lib/libxo/add.man
  head/lib/libxo/libxo/xo_config.h
  head/usr.bin/xohtml/xohtml.sh
Comment 3 Phil Shafer freebsd_committer 2020-01-25 21:22:02 UTC
Fixed in revision 357125.

Thanks,
 Phil