* SRFI-37 and short-name option with optional argument
@ 2020-05-12 20:14 zimoun
2020-05-12 20:28 ` Linus Björnstam
0 siblings, 1 reply; 4+ messages in thread
From: zimoun @ 2020-05-12 20:14 UTC (permalink / raw)
To: Guile User
Dear,
The semantic of short-name option with optional argument is not clear
as the comment says:
http://git.savannah.gnu.org/cgit/guile.git/tree/module/srfi/srfi-37.scm#n58
Let consider that the option '-a, --long-a' has an optional argument
and '-b, --long-b' another option. Currently, from my tests using
SRFI-37:
-a X -b # OK (1)
-aX -b # OK (2)
--long-a -b # OK
-a -b # KO (3)
The semantic of (3) is ambiguous, obviously. :-)
So, it seems that the argument is not optional for the short-name
case. One way to resolve such case is to remove the form (1) when the
short-name '-a' accepts an optional argument.
Does it make sense?
Thank you in advance for your wise advice.
Best regards,
simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SRFI-37 and short-name option with optional argument
2020-05-12 20:14 SRFI-37 and short-name option with optional argument zimoun
@ 2020-05-12 20:28 ` Linus Björnstam
2020-05-15 15:21 ` zimoun
0 siblings, 1 reply; 4+ messages in thread
From: Linus Björnstam @ 2020-05-12 20:28 UTC (permalink / raw)
To: zimoun, Guile User
I Sony have an answer to your question, but using (ice-9 getopt-long)is usually the library guilers reach for unless they want to install third party libraries: https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html#getopt_002dlong
--
Linus Björnstam
On Tue, 12 May 2020, at 22:14, zimoun wrote:
> Dear,
>
> The semantic of short-name option with optional argument is not clear
> as the comment says:
>
> http://git.savannah.gnu.org/cgit/guile.git/tree/module/srfi/srfi-37.scm#n58
>
> Let consider that the option '-a, --long-a' has an optional argument
> and '-b, --long-b' another option. Currently, from my tests using
> SRFI-37:
>
> -a X -b # OK (1)
> -aX -b # OK (2)
> --long-a -b # OK
>
> -a -b # KO (3)
>
> The semantic of (3) is ambiguous, obviously. :-)
>
> So, it seems that the argument is not optional for the short-name
> case. One way to resolve such case is to remove the form (1) when the
> short-name '-a' accepts an optional argument.
>
> Does it make sense?
>
>
> Thank you in advance for your wise advice.
>
> Best regards,
> simon
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SRFI-37 and short-name option with optional argument
2020-05-12 20:28 ` Linus Björnstam
@ 2020-05-15 15:21 ` zimoun
2020-05-15 17:04 ` Zelphir Kaltstahl
0 siblings, 1 reply; 4+ messages in thread
From: zimoun @ 2020-05-15 15:21 UTC (permalink / raw)
To: Linus Björnstam; +Cc: Guile User
Dear Linus,
On Tue, 12 May 2020 at 22:29, Linus Björnstam
<linus.internet@fastmail.se> wrote:
>
> I Sony have an answer to your question, but using (ice-9 getopt-long)is usually the library guilers reach for unless they want to install third party libraries: https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html#getopt_002dlong
Thank you for your answer. But I really would like to use SRFI-37. :-)
All the best,
simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SRFI-37 and short-name option with optional argument
2020-05-15 15:21 ` zimoun
@ 2020-05-15 17:04 ` Zelphir Kaltstahl
0 siblings, 0 replies; 4+ messages in thread
From: Zelphir Kaltstahl @ 2020-05-15 17:04 UTC (permalink / raw)
To: zimoun; +Cc: guile-user
Hi Simon!
Perhaps this will help?
https://notabug.org/ZelphirKaltstahl/guile-examples/src/master/command-line-arguments
Regards,
Zelphir
On 5/15/20 5:21 PM, zimoun wrote:
> Dear Linus,
>
> On Tue, 12 May 2020 at 22:29, Linus Björnstam
> <linus.internet@fastmail.se> wrote:
>> I Sony have an answer to your question, but using (ice-9 getopt-long)is usually the library guilers reach for unless they want to install third party libraries: https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html#getopt_002dlong
> Thank you for your answer. But I really would like to use SRFI-37. :-)
>
> All the best,
> simon
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-15 17:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 20:14 SRFI-37 and short-name option with optional argument zimoun
2020-05-12 20:28 ` Linus Björnstam
2020-05-15 15:21 ` zimoun
2020-05-15 17:04 ` Zelphir Kaltstahl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).