Tools for modeling links between files / URLs / etc.
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
702 B

  1. #!/usr/bin/env perl
  2. =pod
  3. =head1 NAME
  4. pieces - link two things together
  5. =head1 SYNOPSIS
  6. pieces-link links two things together
  7. USAGE:
  8. pieces link "thing1" "thing2"
  9. EXAMPLE:
  10. pieces link "file:///home/brennen/p1k3" "urn:vimwiki:p1k3"
  11. =head1 AUTHOR
  12. Brennen Bearnes
  13. =cut
  14. use warnings;
  15. use strict;
  16. use 5.10.0;
  17. use App::Pieces;
  18. use Cwd qw(cwd abs_path);
  19. use Getopt::Long;
  20. use Pod::Usage;
  21. GetOptions(
  22. # 'config=s' => \$config_file,
  23. help => sub { pod2usage(0) },
  24. ) or pod2usage(2);
  25. my $p = App::Pieces->new();
  26. $p->add_link($ARGV[0], $ARGV[1]);
  27. $p->foreach_row(
  28. 'SELECT * FROM links',
  29. sub {
  30. my ($data) = @_;
  31. say $data->{from_piece} . " " . $data->{to_piece};
  32. }
  33. );