CSS-Prepare

 view release on metacpan or  search on metacpan

bin/cssprepare  view on Meta::CPAN

#!/usr/bin/env perl

use Modern::Perl;

use CSS::Prepare;
use File::stat;
use FileHandle;
use Getopt::Long    qw( :config bundling );
use IO::Handle;
use POSIX           qw( mkfifo );
use Pod::Usage;
use Term::ANSIColor;
use Time::HiRes     qw( gettimeofday tv_interval );
use Storable        qw( retrieve nstore );

use constant OPTIONS => qw(
              use-all-shasum|a
              hierarchy-base|b=s
                 cache-store|c=s
                  output-dir|d=s
             extended-syntax|e
               disable-hacks
                        help|h
                    location|l=s
               assets-output|m=s
                 assets-base|n=s
                    optimise|o
                        pipe=s
                      pretty|p
                       quiet|q
                      server
        suboptimal-threshold|s=i
                     timeout|t=i
               warnings-only|w
               exit-on-error|x
    );



my %options      = get_options_or_exit();
my %prepare_args = get_prepare_arguments( %options );
my $preparer     = CSS::Prepare->new( %prepare_args );
my( $output, $total_saving, $total_errors, %cache );

if ( $options{'cache-store'} ) {
    if ( -f $options{'cache-store'} ) {
        my $store = retrieve $options{'cache-store'};
        %cache = %$store;
    }
}

if ( $options{'server'} ) {
    run_server( @ARGV );
}
elsif ( $options{'pipe'} ) {
    run_pipe( @ARGV );
}
else {
    my @files;
    foreach my $arg ( @ARGV ) {
        if ( -d $arg ) {
            push @files, get_files_in_directory( $arg );
        }

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.455 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )