Skip Menu |

This queue is for tickets about the Getopt-Euclid CPAN distribution.

Report information
The Basics
Id: 38413
Status: resolved
Priority: 0/
Queue: Getopt-Euclid

People
Owner: Nobody in particular
Requestors: duncan_j_ferguson [...] yahoo.co.uk
Cc:
AdminCc:

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



Subject: Feature request or doc update
Date: Tue, 12 Aug 2008 08:29:12 +0100
To: bug-getopt-euclid [...] rt.cpan.org
From: Duncan Ferguson <duncan_j_ferguson [...] yahoo.co.uk>
Hiya, I have a script I want to break out into modules are part of it needs to be used in another script. I am looking at using Getopt::Euclid to provide the common command line documentation. The command line I am trying to document (currently done via Getopt::Std) is script.pl [-a] [-b] [-c] [[user@]hostname[:port] ... The first part is ok, but I am struggling with how to complete the hostname part - how do I include that within the docs? It seem unflagged placeholders dont quite fit what I am trying to to (after all, which part of it becomes the placeholder? Or, instead, how can I write the POD such that they are left in @ARGV so i can process those after Getopt::Euclid has finished with the rest? As an example the script could be called as script.pl script.pl hostname script.pl hostname hostname script.pl hostname:port username@hostname username@hostname:port hostname etc... I dont want to put a flag in front of all the hostname as that would break backwards compatibility. This on on version 0.2.0 by the way. Thanks Duncs
Please see attached file for how to do this.
#!/usr/bin/env perl use strict; use warnings; use Getopt::Euclid; use YAML::Syck; print Dump \%ARGV; =head1 OPTIONS =item [<user>@]<hostname>[:<port>] =for Euclid: repeatable hostname.type: /[^:]+/ =cut