Permalink
Browse files

Default to META.json.

  • Loading branch information...
1 parent 52e13e4 commit 8e009dd5a92af1fbebc707d2c21093bff025fc09 @theory theory committed Nov 28, 2011
Showing with 12 additions and 4 deletions.
  1. +2 −0 Changes
  2. +10 −4 bin/validate_pgxn_meta
View
@@ -3,6 +3,8 @@ Revision history for Perl extension PGXN-Meta-Validator.
0.15.0
- Added `version_string` class method and made use of it in the
`validate_pgxn_meta` script.
+ - The command-line app now defaults to a file named `META.json` in the
+ current directory if no file name is passed.
0.14.0 2011-08-31T03:44:57Z
- Added tests to protect against autovivication of keys.
View
@@ -23,7 +23,7 @@ if ($version) {
exit;
}
-my $file = shift or _pod2usage();
+my $file = shift || -e 'META.json' ? 'META.json' : _pod2usage();
die "$file is not a valid, readable filename\n" unless -r $file;
my $pmv = PGXN::Meta::Validator->load_file($file);
@@ -38,13 +38,12 @@ print "$file is invalid. Errors:\n ",
"\n";
exit 1;
-
sub _pod2usage {
require Pod::Usage;
my $sections = 'Usage|Options';
if ($0 =~ /pgxn-validate-meta/) {
- print "Usage:\n pgxn validate-meta META.json\n\n";
+ print "Usage:\n pgxn validate-meta\n pgxn validate-meta mumble.json\n\n";
$sections = 'Options';
}
Pod::Usage::pod2usage(
@@ -65,14 +64,21 @@ validate_pgxn_meta - Validate the structure of a PGXN F<META.json> file
=head1 Usage
- validate_pgxn_meta META.json
+ validate_pgxn_meta
+ validate_pgxn_meta mumble.json
=head1 Options
-h --help Print a usage statement and exit.
-M --man Print the complete documentation and exit.
-v --version Print the version number and exit.
+=head1 Description
+
+Validates a PGXN F<META.json> file against the PGXN meta specification. If a
+file name is passed, that file will be validated. Otherwise, if a file named
+F<META.json> exists in the current directory, it will be validated.
+
=head1 Output
If F<META.json> valid, the output will be:

0 comments on commit 8e009dd

Please sign in to comment.