/
usr
/
local
/
bin
/
/usr/local/bin
mkdir
upload
Name
Size
Mode
Actions
config_data
7138
0555
edit
dl
rm
crc32
1043
0555
edit
dl
rm
crontab
3320736
0755
edit
dl
rm
drush
6138646
0755
edit
dl
rm
drush.phar
6138646
0755
edit
dl
rm
ea-php72
5815400
0755
edit
dl
rm
ea-php73
5647288
0755
edit
dl
rm
ea-php74
6383296
0755
edit
dl
rm
ea-php80
7986080
0755
edit
dl
rm
ea-php81
8098952
0755
edit
dl
rm
ea_convert_php_ini
40811
0755
edit
dl
rm
ea_current_to_profile
11519
0755
edit
dl
rm
ea_install_profile
7274
0755
edit
dl
rm
ea_sync_user_phpini_settings
6888
0755
edit
dl
rm
htmltree
1173
0555
edit
dl
rm
instmodsh
4194
0555
edit
dl
rm
ipcount
3724
0555
edit
dl
rm
iptab
982
0555
edit
dl
rm
json_pp
3828
0555
edit
dl
rm
json_xs
7013
0555
edit
dl
rm
lsphp
937
0755
edit
dl
rm
lwp-download
8635
0555
edit
dl
rm
lwp-dump
2797
0555
edit
dl
rm
lwp-mirror
2478
0555
edit
dl
rm
lwp-request
15059
0555
edit
dl
rm
mech-dump
4623
0555
edit
dl
rm
passwd
3768664
0755
edit
dl
rm
pear
935
0755
edit
dl
rm
php
933
0755
edit
dl
rm
php-config
6384
0755
edit
dl
rm
prove
13457
0555
edit
dl
rm
ptar
3456
0555
edit
dl
rm
ptardiff
2535
0555
edit
dl
rm
ptargrep
4299
0555
edit
dl
rm
shasum
9287
0555
edit
dl
rm
tpage
8923
0555
edit
dl
rm
ttree
39234
0555
edit
dl
rm
wp
6928461
0755
edit
dl
rm
wp-cli.phar
6928461
0755
edit
dl
rm
zipdetails
48366
0555
edit
dl
rm
Edit:
/usr/local/bin/json_pp
(3828B)
#!/usr/bin/perl use strict; use Getopt::Long; use JSON::PP (); my $VERSION = '1.00'; # imported from JSON-XS/bin/json_xs my %allow_json_opt = map { $_ => 1 } qw( ascii latin1 utf8 pretty indent space_before space_after relaxed canonical allow_nonref allow_singlequote allow_barekey allow_bignum loose escape_slash ); GetOptions( 'v' => \( my $opt_verbose ), 'f=s' => \( my $opt_from = 'json' ), 't=s' => \( my $opt_to = 'json' ), 'json_opt=s' => \( my $json_opt = 'pretty' ), 'V' => \( my $version ), ) or die "Usage: $0 [-v] -f from_format [-t to_format]\n"; if ( $version ) { print "$VERSION\n"; exit; } $json_opt = '' if $json_opt eq '-'; my @json_opt = grep { $allow_json_opt{ $_ } or die "'$_' is not a valid json option" } split/,/, $json_opt; my %F = ( 'json' => sub { my $json = JSON::PP->new; $json->$_() for @json_opt; $json->decode( $_ ); }, 'eval' => sub { my $v = eval "no strict;\n#line 1 \"input\"\n$_"; die "$@" if $@; return $v; }, ); my %T = ( 'null' => sub { "" }, 'json' => sub { my $json = JSON::PP->new; $json->$_() for @json_opt; $json->encode( $_ ); }, 'dumper' => sub { require Data::Dumper; Data::Dumper::Dumper($_) }, ); $F{$opt_from} or die "$opt_from: not a valid fromformat\n"; $T{$opt_to} or die "$opt_from: not a valid toformat\n"; local $/; $_ = <STDIN>; $_ = $F{$opt_from}->(); $_ = $T{$opt_to}->(); print $_; __END__ =pod =encoding utf8 =head1 NAME json_pp - JSON::PP command utility =head1 SYNOPSIS json_pp [-v] [-f from_format] [-t to_format] [-json_opt options_to_json] =head1 DESCRIPTION json_pp converts between some input and output formats (one of them is JSON). This program was copied from L<json_xs> and modified. The default input format is json and the default output format is json with pretty option. =head1 OPTIONS =head2 -f -f from_format Reads a data in the given format from STDIN. Format types: =over =item json as JSON =item eval as Perl code =back =head2 -t Writes a data in the given format to STDOUT. =over =item null no action. =item json as JSON =item dumper as Data::Dumper =back =head2 -json_opt options to JSON::PP Acceptable options are: ascii latin1 utf8 pretty indent space_before space_after relaxed canonical allow_nonref allow_singlequote allow_barekey allow_bignum loose escape_slash =head2 -v Verbose option, but currently no action in fact. =head2 -V Prints version and exits. =head1 EXAMPLES $ perl -e'print q|{"foo":"あい","bar":1234567890000000000000000}|' |\ json_pp -f json -t dumper -json_opt pretty,utf8,allow_bignum $VAR1 = { 'bar' => bless( { 'value' => [ '0000000', '0000000', '5678900', '1234' ], 'sign' => '+' }, 'Math::BigInt' ), 'foo' => "\x{3042}\x{3044}" }; $ perl -e'print q|{"foo":"あい","bar":1234567890000000000000000}|' |\ json_pp -f json -t dumper -json_opt pretty $VAR1 = { 'bar' => '1234567890000000000000000', 'foo' => "\x{e3}\x{81}\x{82}\x{e3}\x{81}\x{84}" }; =head1 SEE ALSO L<JSON::PP>, L<json_xs> =head1 AUTHOR Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt> =head1 COPYRIGHT AND LICENSE Copyright 2010 by Makamaka Hannyaharamitu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut
Save
cmd:
run