Skip to content

Commit

Permalink
add 'version' command
Browse files Browse the repository at this point in the history
  • Loading branch information
grantm committed Jul 5, 2011
1 parent 011970c commit 91be5d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bin/nzigovt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ my(%opt);

if(!GetOptions(\%opt,
'help|?',
'version',
'conf_dir|conf-dir|c=s',
'allow_create|allow-create',
'env=s',
Expand All @@ -41,6 +42,8 @@ if($opt{help} or (@ARGV && $ARGV[0] eq 'help')) {
pod2usage(-exitstatus => 0, -verbose => 2);
}

$ARGV[0] ||= 'version' if $opt{version};

eval { Authen::NZigovt->run_command(\%opt, @ARGV); };
if($@) {
pod2usage(-exitstatus => 1, -verbose => 0, -message => "$@");
Expand All @@ -66,6 +69,7 @@ nzigovt - Tools for interacting with the New Zealand 'igovt Logon Service'
make-req generate a SAML AuthnRequest, encoded as a URL
dump-req dissect the provided URL and dump the XML
resolve resolve an artifact to an FLT
version print module version number and exit
help detailed help message

Options:
Expand Down Expand Up @@ -145,6 +149,14 @@ from the response.
Note: in practice a SML artifact must be resolved very soon after it is
generated or it will expire.

=item version

Print version number of L<Authen::NZigovt> module and exit.

=item help

Display this documentation.

=back


Expand Down Expand Up @@ -182,10 +194,6 @@ The CN will be calculated for you based on --domain. The O and OU will be
added based on --org and --org-unit. Prefix each fieldname with a forward
slash (e.g.: --subject /L=Wellington/ST=Wellington/C=NZ).

=item B<< --help >> (alias -?)

Display this documentation.

=back


Expand Down
5 changes: 5 additions & 0 deletions lib/Authen/NZigovt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ sub _dispatch_resolve {
}


sub _dispatch_version {
print $Authen::NZigovt::VERSION, "\n";
}


sub _conf_dir {
my($opt) = @_;

Expand Down

0 comments on commit 91be5d1

Please sign in to comment.