7 our $VERSION = '0.000_001';
9 use App
::Cmd
::Setup
'-app';
10 use parent qw
/Class::Accessor::Fast/;
11 __PACKAGE__
->mk_accessors(qw
/path zeal config verbose/);
13 use Class
::Method
::Modifiers qw
/before/;
16 use File
::Spec
::Functions qw
/catfile/;
20 use constant DEFAULT_PATH
=> $ENV{HOME
} ? catfile
$ENV{HOME
}, '.docsets' : '.docsets';
22 sub allow_any_unambiguous_abbrev
() { 1 }
23 sub default_command
{ 'commands' } # Show usage when called without arguments
26 (['config|c=s' => 'Path to configuration file'],
27 ['path|p=s' => 'Path to docset directory',],
28 ['verbose|v!' => 'Print verbose debugging output'])
33 return Config
::Auto
::parse
($cfg) if $cfg;
34 eval { Config
::Auto
::parse
} or {}
37 before
'execute_command' => sub {
39 my %opts = %{$self->global_options};
40 my $config = parse_config
$ENV{ZEALC_CONFIG
} || $opts{config
};
41 my %config = %$config;
42 my $path = $opts{path
} || $config{path
} || DEFAULT_PATH
;
43 mkdir $path unless -d
$path;
45 my $zeal = Zeal
->new($path);
48 $self->config($config);
49 $self->verbose($opts{verbose
} || $config{verbose
})
59 App::Zealc - command-line offline documentation browser for Dash/Zeal docsets
68 zealc is a command-line offline documentation browser inspired by
69 L<Dash|http://kapeli.com/dash> and L<Zeal|http://zealdocs.org>. It
70 uses Dash/Zeal format docsets via the L<Zeal> library.
78 Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
80 =head1 COPYRIGHT AND LICENSE
82 Copyright (C) 2015 by Marius Gavrilescu
84 This library is free software; you can redistribute it and/or modify
85 it under the same terms as Perl itself, either Perl version 5.20.1 or,
86 at your option, any later version of Perl 5 you may have available.