#!/usr/bin/env perl
|
|
|
|
=pod
|
|
|
|
=head1 NAME
|
|
|
|
marks-ls - list the current set of marked files
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
marks-ls lists the current set of marked files
|
|
|
|
USAGE:
|
|
marks ls
|
|
|
|
# List files separated by NUL characters:
|
|
marks ls --print0
|
|
marks ls -0
|
|
|
|
=head1 AUTHOR
|
|
|
|
Brennen Bearnes
|
|
|
|
=cut
|
|
|
|
use strict;
|
|
use warnings;
|
|
use 5.10.0;
|
|
|
|
use App::MarkFiles qw(each_path);
|
|
use Getopt::Long;
|
|
use Pod::Usage;
|
|
|
|
my $print0;
|
|
GetOptions(
|
|
help => sub { pod2usage(0) },
|
|
'print0|0' => \$print0,
|
|
) or pod2usage(2);
|
|
|
|
my $separator = "\n";
|
|
if ($print0) {
|
|
$separator = "\0";
|
|
}
|
|
|
|
each_path(sub {
|
|
my ($path) = @_;
|
|
print $path;
|
|
print $separator;
|
|
});
|