Skip Menu |

This queue is for tickets about the IO-Prompt CPAN distribution.

Report information
The Basics
Id: 58456
Status: rejected
Priority: 0/
Queue: IO-Prompt

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: 2 arg open
just wondering why so many 2 arg opens still in IO::Prompt p.s. also wondering why you don't close bugs.... I notice this dist has a lot of open bugs that looks like they should be closed.
Subject: Re: [rt.cpan.org #58456] 2 arg open
Date: Thu, 17 Jun 2010 04:11:21 +1000
To: bug-IO-Prompt [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> just wondering why so many 2 arg opens still in IO::Prompt
Mainly because this module is not under active maintenance. In fact, its successor (IO::Prompter) is being readied for release this week, and does indeed to conform to much better coding practices including radical ideas like full user documentation and proper internal commenting. And, yes, it does employ proper 3-arg opens as well. ;-) Show quoted text
> p.s. also wondering why you don't close bugs.... I notice this dist has a > lot of open bugs that looks like they should be closed.
Even though an RT stream is imposed on every CPAN author's every module, not every CPAN author chooses to use the facility. For me, RT is just another email stream, one that usually brings bad news. ;-) Damian
Show quoted text
> Mainly because this module is not under active maintenance. In fact,
its Show quoted text
> successor (IO::Prompter) is being readied for release this week, and > does indeed to conform to much better coding practices including
radical Show quoted text
> ideas like full user documentation and proper internal commenting. And,
yes, I'll be looking for that. If it's the successor perhaps I'd better use that instead of this for my conversion.
Subject: Re: [rt.cpan.org #58456] 2 arg open
Date: Fri, 18 Jun 2010 04:24:15 +1000
To: bug-IO-Prompt [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> I'll be looking for that. If it's the successor perhaps I'd better use > that instead of this for my conversion.
It would certainly be worth assessing. It has a slightly different feature set to its predecessor, so it would probably depend on what you were using it for. Here's the quick summary from the IO::Prompter docs: Short Long form form Effect ===== ============= ====================================== -a -argv Prompt for @ARGV data if !@ARGV -comp[lete]=>SPEC Complete input on <TAB>, as specified -dSTR -def[ault]=>STR What to return if only <ENTER> typed -DEF[AULT]=>STR (as above, but skip any -must checking) -e[STR] -echo=>STR Echo string for each character typed -fail=>VALUE Return failure if input smartmatches value -guar[antee]=>SPEC Only allow the specified words to be entered -h[STR] -hist[ory][=>SPEC] Specify the history set this call belongs to -in=>HANDLE Read from specified handle -i -integer[=>SPEC] Accept only valid integers (that smartmatch SPEC) -k -keyletters Accept only keyletters (as specified in prompt) -l -line Don't autochomp -menu=>SPEC Specify a menu of responses to be displayed -must=>HASHREF Specify requirements/constraints on input -n -num[ber][=>SPEC] Accept only valid numbers (that smartmatch SPEC) -out=>HANDLE Prompt to specified handle -prompt=>STR Specify prompt explicitly -rSTR -ret[urn]=>STR After input, echo this string instead of <CR> -s -1 -sing[le] Return immediately after first key pressed -stdio Use STDIN and STDOUT for prompting -tNUM -time[out]=>NUM Specify a timeout on the input operation -v -verb[atim] Return the input string (no context sensitivity) -w -wipe Clear screen -wipefirst Clear screen on first prompt() call only -y -yes Return true if [yY] entered, false otherwise -yn -yesno Return true if [yY] entered, false if [nN] -Y -Yes Return true if Y entered, false otherwise -YN -YesNo Return true if Y entered, false if N -_ No-op (handy for bundling ambiguous short forms) It will be on CPAN by Tuesday June 22, 2010 Damian
I'm guessing -in would allow me to specify a way to provide the answers from like a __DATA__ section? will there be a way with argv to say answer default on all?
Subject: Re: [rt.cpan.org #58456] 2 arg open
Date: Fri, 18 Jun 2010 06:16:47 +1000
To: bug-IO-Prompt [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> I'm guessing -in would allow me to specify a way to provide the answers > from like a __DATA__ section?
Correct. Show quoted text
> Will there be a way with argv to say answer > default on all?
There will now. ;-) (Though maybe not in time for next week's release.) Damian
Subject: Re: [rt.cpan.org #58456] 2 arg open
Date: Thu, 17 Jun 2010 16:53:58 -0400
To: bug-IO-Prompt [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
will there be a way to pass variables as answers besides handles? so then maybe one could add ... less ... linear way to program things... I imagine handles might be somewhat linear (or at least ugly). I'm thinking kinda like $return = prompt('question: ', -yn, -answer => "$input"); then I could combine with getopt to provide like an all yes or all no gives me more UI options basically. -- Caleb Cushing http://xenoterracide.blogspot.com
Subject: Re: [rt.cpan.org #58456] 2 arg open
Date: Fri, 18 Jun 2010 08:29:54 +1000
To: bug-IO-Prompt [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> will there be a way to pass variables as answers besides handles? > > $return = prompt('question: ', -yn, -answer => "$input");
I'm afraid I'm not sure what you're trying to achieve there, precisely. You *can* do the following, to provide a default if they just hit <ENTER>: $return = prompt('question: ', -yn, -default => "$input"); or you can do the following to provide a default if they enter an EOF: $return = prompt('question: ', -yn) || "$input"; or you can even combine the two. Is that what you were asking about? Damian
Subject: Re: [rt.cpan.org #58456] 2 arg open
Date: Fri, 18 Jun 2010 23:35:41 -0400
To: bug-IO-Prompt [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
On Thu, Jun 17, 2010 at 6:30 PM, damian@conway.org via RT <bug-IO-Prompt@rt.cpan.org> wrote: Show quoted text
> Is that what you were asking about? >
no not really but now that I think more about it, what I was thinking about really wouldn't be needed. -- Caleb Cushing http://xenoterracide.blogspot.com