Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2019 01:06:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 238232] [patch] sysrc ignores the -i ignore flag
Message-ID:  <bug-238232-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238232

            Bug ID: 238232
           Summary: [patch] sysrc ignores the -i ignore flag
           Product: Base System
           Version: 12.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: yannk@apple.com

Created attachment 204709
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D204709&action=
=3Dedit
simple patch to sysrc for -i

There is no functional difference between -q and -i.

The -i flag is documented as:

   Ignore unknown variables.

The -q flag is documented as:

   Quiet.  Disable verbose and hide certain errors.  When combined
   with =E2=80=98-L=E2=80=99 and one or more name arguments, provide only e=
xit
   status and no output.


The current behavior is observed:

$ sysrc unknown
sysrc: unknown variable 'unknown'
$ echo $?
1
$ sysrc -q unknown
$ echo $?
1
$ sysrc -i unknown
$ echo $?
1


When the following behavior is expected:
$ sysrc -i unknown
sysrc: unknown variable 'unknown'
$ echo $?
0

Combining with the -q flag
$ sysrc -q -i unknown
$ echo $?
0

The following patch:
- Makes -i exit code 0
- Makes -i not suppress output unless combined with -q

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238232-227>