A utility to mark and operate on files in the shell.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
654 B

  1. #!/usr/bin/env perl
  2. =pod
  3. =head1 NAME
  4. marks-ls - list the current set of marked files
  5. =head1 SYNOPSIS
  6. marks-ls lists the current set of marked files
  7. USAGE:
  8. marks ls
  9. # List files separated by NUL characters:
  10. marks ls --print0
  11. marks ls -0
  12. =head1 AUTHOR
  13. Brennen Bearnes
  14. =cut
  15. use strict;
  16. use warnings;
  17. use 5.10.0;
  18. use App::MarkFiles qw(each_path);
  19. use Getopt::Long;
  20. use Pod::Usage;
  21. my $print0;
  22. GetOptions(
  23. help => sub { pod2usage(0) },
  24. 'print0|0' => \$print0,
  25. ) or pod2usage(2);
  26. my $separator = "\n";
  27. if ($print0) {
  28. $separator = "\0";
  29. }
  30. each_path(sub {
  31. my ($path) = @_;
  32. print $path;
  33. print $separator;
  34. });