root/lang/perl/Config-Pit/trunk/bin/ppit @ 4218

Revision 4218, 1.0 kB (checked in by yappo, 6 years ago)

lang/perl/Config-Pit: code golf nized

Line 
1#!/usr/bin/perl
2use strict;
3use warnings;
4use FindBin;
5use Path::Class;
6use YAML;
7use File::Temp;
8use Pod::Usage;
9
10use lib file( $FindBin::RealBin, '..', 'lib' )->stringify;
11use Config::Pit;
12
13({
14    get    => sub { printf "%s\n", YAML::Dump(Config::Pit::get(shift)) },
15    set    => \&Config::Pit::set,
16    switch => \&Config::Pit::switch,
17}->{(shift || '')} || sub { pod2usage } )->($ARGV[1]);
18
19__END__
20
21=head1 SYNOPSIS
22
23    $ ppit [get|set|switch] <value>
24    $ ppit help
25
26 Options:
27        get <name>        => Get values of <name>.
28        set <name>        => Config values of name with $EDITOR.
29        switch <profile>  => Switch profile to <profile>.
30        help              => show this manual
31
32=head1 DESCRIPTION
33
34pit command for Perl
35
36=head1 AUTHOR
37
38Kazuhiro Osawa
39
40=head1 LICENSE
41
42This library is free software; you can redistribute it and/or modify
43it under the same terms as Perl itself.
44
45=head1 SEE ALSO
46
47L<pit gem|http://lowreal.rubyforge.org/pit/>
48C<Config::Pit>
49
50=cut
51
Note: See TracBrowser for help on using the browser.