App-GrepUtils

 view release on metacpan or  search on metacpan

script/grep-nonblank  view on Meta::CPAN

#!perl

use 5.010001;
use strict;
use warnings;
#use Log::ger;

use Getopt::Long;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2026-07-16'; # DATE
our $DIST = 'App-GrepUtils'; # DIST
our $VERSION = '0.007'; # VERSION

sub parse_cmdline {
    Getopt::Long::Configure('auto_abbrev', 'pass_through');
    my $res = GetOptions(
        'version|V'        => sub {
            no warnings 'once';
            say "grep-terms version ", ($main::VERSION // 'dev');
            exit 0;
        },
        'help'           => sub {
            print <<USAGE;
Usage:
  grep-nonblank [OPTIONS | FILES]...
  grep-nonblank --help
  grep-nonblank --version|-V

Examples:
  % grep-nonblank file.txt
  % clipget | grep-nonblank | clipadd

For more details, see the manpage/documentation.
USAGE
            exit 0;
        },
    );
    exit 99 if !$res;
}

sub run {
    while (<>) {
        print if /\S/;
    }
}

# MAIN

parse_cmdline();
run();

1;
# ABSTRACT: Print lines that are not blank
# PODNAME: grep-nonblank

__END__

=pod

=encoding UTF-8

=head1 NAME

grep-nonblank - Print lines that are not blank

=head1 VERSION

This document describes version 0.007 of grep-nonblank (from Perl distribution App-GrepUtils), released on 2026-07-16.

=head1 SYNOPSIS

 % grep-nonblank [OPTIONS | FILES]...
 % grep-nonblank --help
 % grep-nonblank --version|-V

Examples:

 % grep-nonblank file.txt
 % clipget | grep-nonblank | clipadd



( run in 1.785 second using v1.01-cache-2.11-cpan-9169edd2b0e )