Bug 208169 - [patch] df(1): df -l -l output "df: -l and -t are mutually exclusive."
Summary: [patch] df(1): df -l -l output "df: -l and -t are mutually exclusive."
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: i386 Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-03-21 03:02 UTC by by
Modified: 2018-03-15 09:43 UTC (History)
2 users (show)

See Also:


Attachments
Fix output message which does not specify the exact situation. (774 bytes, patch)
2016-03-21 03:02 UTC, by
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description by 2016-03-21 03:02:19 UTC
Created attachment 168442 [details]
Fix output message which does not specify the exact situation.

Overview:
If type command "df -l -l", the output will be:
df: -l and -t are mutually exclusive.

Obviously, the output message does not tell the truth.

I have created a patch which should fix this issue.

Thanks.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2016-08-31 16:00:50 UTC
Given the manual page description, I think I would instead just ignore the second lflag.  Like so:

--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -166,6 +166,9 @@ main(int argc, char *argv[])
                        hflag = 0;
                        break;
                case 'l':
+                       /* Ignore duplicate -l */
+                       if (lflag)
+                               break;
                        if (vfslist != NULL)
                                xo_errx(1, "-l and -t are mutually exclusive.");
                        vfslist = makevfslist(makenetvfslist());
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-08-31 18:11:35 UTC
A commit references this bug:

Author: cem
Date: Wed Aug 31 18:10:41 UTC 2016
New revision: 305139
URL: https://svnweb.freebsd.org/changeset/base/305139

Log:
  df(1): Allow duplicate -l flags gracefully

  Rather than producing a misleading error message when duplicate -l flags are
  provided to df(1), simply ignore extra flags and proceed as if only one was
  specified.  This seems most reasonable given the usage for -l:

       -l      Only display information about locally-mounted file systems.

  l and t flags still conflict, as before.

  PR:		208169
  Reported by:	by at reorigin.com
  Reviewed by:	allanjude

Changes:
  head/bin/df/df.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-03-15 09:43:42 UTC
A commit references this bug:

Author: eadler
Date: Thu Mar 15 09:43:39 UTC 2018
New revision: 330982
URL: https://svnweb.freebsd.org/changeset/base/330982

Log:
  MFC r305139:

  df(1): Allow duplicate -l flags gracefully

  Rather than producing a misleading error message when duplicate -l flags are
  provided to df(1), simply ignore extra flags and proceed as if only one was
  specified.  This seems most reasonable given the usage for -l:

       -l      Only display information about locally-mounted file systems.

  l and t flags still conflict, as before.

  PR:		208169

Changes:
_U  stable/11/
  stable/11/bin/df/df.c