public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Robert Milasan <rmilasan@suse.com>
Cc: util-linux@vger.kernel.org
Subject: Re: swapon: fix -d short option
Date: Tue, 21 Oct 2014 11:55:25 +0200	[thread overview]
Message-ID: <20141021095525.GG8057@x2.net.home> (raw)
In-Reply-To: <20141021100246.3e956b6d@viper.suse.cz>

On Tue, Oct 21, 2014 at 10:02:46AM +0200, Robert Milasan wrote:
> When -d option is used with swapon, is expected that there is an equal
> '=' which at least according to the man page it doesn't make sense or
> it's not properly explained.

Well, in the man page there was incorrectly extra space between -d and
the optional argument. Fixed yesterday.

> If we use -d as we should, then swapon takes 'once' or 'pages' as an
> actual device:
> 
> dhcp33:~ # swapon -p -2 -d once /dev/sdb1
> swapon: stat failed once: No such file or directory
> 
> The short option -d, should be something like "swapon -d once ...." not
> "swapon -d=once ...."

What? The argument for -d is optional, it's reason why we care about
'='. I think it's obvious from the code.

   swapon -p -2 -d /dev/sdb1 

is pretty valid.

Note that -d,--discard has been implemented in 2010, and extended by
'once' and 'pages' later in 2013.

> I've attached the patch to fix this small issue.

Sorry, but the patch does not make sense.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2014-10-21  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  8:02 swapon: fix -d short option Robert Milasan
2014-10-21  9:55 ` Karel Zak [this message]
2014-10-21 10:07   ` Robert Milasan
2014-10-21 10:38     ` Karel Zak
2014-10-21 19:41       ` Benno Schulenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141021095525.GG8057@x2.net.home \
    --to=kzak@redhat.com \
    --cc=rmilasan@suse.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox