Skip to content
Back to formatted view

Raw Message

Message-ID: <CAMigB8HST=tTVDb19KErMqaetn7pKDNBwbPeUpOq5n4hu-kXmg@mail.gmail.com>
Date: 2012-02-16T09:55:49Z
From: Trevor Davis
Subject: optparse::parse_args, using equals sign or not
In-Reply-To: <4F326562.8090300@gmail.com>

> Hi
>
> We've found that when using parse_args(..., positional_arguments=FALSE), it
> is permissible to invoke our script with either "--myfoo=bar" or "--myfoo
> bar"; that is, whether or not the equals sign is present makes no
> difference, and in fact both usage forms are demonstrated in the optparse
> vignette.
>
> However, we've found that when using parse_args(...,
> positional_arguments=TRUE), it is no longer possible to use the equals sign;
> that is, "--myfoo=bar" will show up as a positional argument, with "myfoo"
> set to its default value instead.
>
> Wondering if this is really the intended behavior? Some of our scripts use
> positional arguments and some do not, and we'd like to arrive at a standard
> usage across all scripts.
>
> Many thanks,
> Ben

This bug when using long flag arguments with an equals sign when
positional_arguments=TRUE was fixed in the version of optparse just
uploaded to CRAN (version 0.9.5).  Windows and MAC binaries are being
compiled (and are also available on R-Forge).

Trevor