Skip to content

Commit 3b74de1

Browse files
author
Chris White
committed
Move version info to App.pm
Also: - remove lib/XML/Axk.pm, which we no longer need - switch to Perl-packed (six-digit) semver
1 parent fbc5eb9 commit 3b74de1

File tree

4 files changed

+28
-79
lines changed

4 files changed

+28
-79
lines changed

Makefile.PL

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ EOT
3333
WriteMakefile(
3434
NAME => 'XML::Axk',
3535
AUTHOR => q{Christopher White <[email protected]>},
36-
VERSION_FROM => 'lib/XML/Axk.pm',
37-
ABSTRACT_FROM => 'lib/XML/Axk.pm',
36+
VERSION_FROM => 'lib/XML/Axk/App.pm',
37+
ABSTRACT => 'ack-like XML processor',
3838
LICENSE => 'artistic_2',
3939
EXE_FILES => [ 'bin/axk' ],
4040
MIN_PERL_VERSION => '5.018',

lib/XML/Axk.pm

Lines changed: 0 additions & 63 deletions
This file was deleted.

lib/XML/Axk/App.pm

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ use XML::Axk::Core;
44

55
#BEGIN { require Exporter; $Exporter::Verbose=1; }
66

7-
use version 0.77; our $VERSION = version->declare("v0.1.0");
7+
# Semantic versioning, packed per Perl rules. Must always be at least one
8+
# digit left of the decimal, and six digits right of the decimal. For
9+
# prerelease versions, put an underscore before the last three digits.
10+
our $VERSION = '0.001_002';
811

912
use Getopt::Long qw(GetOptionsFromArray :config gnu_getopt);
1013

11-
#use Web::Query::LibXML;
12-
1314
use constant DEBUG => false;
1415

1516
# Shell exit codes
@@ -136,8 +137,10 @@ sub Main {
136137
parse_command_line(from => $lrArgs, into => \%opts);
137138

138139
if($opts{PRINT_VERSION}) {
139-
use XML::Axk;
140-
say "axk $XML::Axk::VERSION";
140+
$VERSION =~ m<^([^\.]+)\.(\d{3})(_?)(\d{3})>;
141+
printf "axk version %d.%d.%d ($VERSION)%s\n", $1, $2, $4,
142+
($3 ? ' (dev)' : '');
143+
141144
return 0;
142145
}
143146

@@ -187,10 +190,6 @@ __END__
187190
188191
XML::Axk::App - ack-like XML processor, command-line interface
189192
190-
=head1 VERSION
191-
192-
Version 0.1.0
193-
194193
=head1 USAGE
195194
196195
axk [options] [--] [script] [input filename(s)]
@@ -217,14 +216,14 @@ Run the axk code given as B<text>.
217216
218217
Run the axk code given in the file called B<filename>.
219218
220-
=item -L, --language B<language>
219+
=item -L, --language B<lang>
221220
222221
B<Not yet implemented:>
223-
Interpret the following B<-e> in axk language B<language>.
222+
Interpret the following B<-e> in axk language B<lang>.
224223
225224
=item --show B<what>
226225
227-
Show debugging information. Currently implemented are:
226+
Show debugging information. Currently-implemented B<what> values are:
228227
229228
=over
230229
@@ -245,6 +244,21 @@ Print the version of axk and exit
245244
246245
=back
247246
247+
=head1 PERL INTERFACE
248+
249+
For use in Perl programs:
250+
251+
use XML::Axk::App; # pick whichever you want,
252+
use XML::Axk::Core; # or both
253+
254+
# Canned interface, as if run from the command line
255+
XML::Axk::App::Main(\@ARGV)
256+
257+
# Perl interface
258+
my $axk = XML::Axk::Core->new();
259+
260+
For details about the library interface, see L<XML::Axk::Core>.
261+
248262
=head1 AUTHOR
249263
250264
Christopher White, C<cxwembedded at gmail.com>

lib/XML/Axk/Core.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ sub eval_nolex {
1919
use XML::Axk::Language ();
2020
use XML::Axk::Sandbox;
2121

22-
use version 0.77; our $VERSION = version->declare("v0.1.0");
23-
2422
# Private vars ========================================================== {{{1
2523

2624
# For giving each script a unique package name

0 commit comments

Comments
 (0)