#!/usr/bin/env perl

use strict;
use warnings;
use File::LinkDir;
File::LinkDir::run();

=encoding UTF-8

=head1 NAME

link-files - Create symlinks in one directory for files in another

=head1 SYNOPSIS

B<link-files> <options>

 Options:
  -n, --dry-run             Don't actually do anything
  -s DIR, --source=DIR      The source directory
  -d DIR, --dest=DIR        The destination directory
  -r, --recursive           Recurse into subdirectories (see below)
  -i RX, --ignore=RX        A regex matching files to ignore (see below)
  -a RX, --add-ignore=RX    Like -i but doesn't replace the default
  -f, --force               Overwrite existing files/dirs
  -h, --help                Display this help message
  -v, --version             Display version information

By default, B<link-files> will create symlinks in the destination directory for
all top-level files, directories or symlinks found in the source directory.
This is very useful for keeping the dot files in your C<$HOME> under version
control. A typical use case:

 cd ~/src/dotfiles
 # update or add files, commit to repository
 link-files --source . --dest ~

With C<--recursive>, B<link-files> will not create symlinks to subdirectories
found in the source directory. It will instead recurse into them and create
symlinks for any files or symlinks it finds. Any subdirectories not found in
the destination directory will be created. This approach is useful for
destination directories where programs or users other than yourself might add
things to subdirectories which you don't want ending up in your working tree
implicitly. F</etc> is a good example.

In both cases, symlinks from the source directory will be copied as-is. This
makes sense because the symlinks might be relative.

If C<--ignore> is not specified, it defaults to ignoring F<.git> and F<.svn>
directories and their contents.

=head1 AUTHOR

Hinrik E<Ouml>rn SigurE<eth>sson, hinrik.sig@gmail.com

=head1 LICENSE AND COPYRIGHT

Copyright 2009 Hinrik E<Ouml>rn SigurE<eth>sson

This program is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut
