diff options
author | Pablo Olmos de Aguilera Corradini <pablo@glatelier.org> | 2014-02-22 13:16:51 -0300 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2014-02-24 15:57:00 +0100 |
commit | 7cb654e31e5ecc2eff6795928cb7fce416c60fdb (patch) | |
tree | 737a1acb531b474bf454e9c5da914d961a4ff9a5 | |
parent | a5bb6d59b77785efa57b226a0cb45ff07390af6b (diff) |
Add sigil (`$`) for symlinked dir for lsrc -F
The `$` sigil in `-F` indicates that the directory is symlinked instead
of recurred upon.
Fixes #37.
-rwxr-xr-x | bin/lsrc | 10 | ||||
-rw-r--r-- | man/lsrc.1 | 17 |
2 files changed, 20 insertions, 7 deletions
@@ -71,7 +71,9 @@ show_dir() { sigil_for() { local file=$1 + local symlink_dirs_file_globs=$2 local copy_always=0 + local symlink_dirs=0 for copy_file in $COPY_ALWAYS; do $DEBUG "copy_file: $copy_file" @@ -85,8 +87,14 @@ sigil_for() { esac done + if [ -n "$symlink_dirs_file_globs" ]; then + symlink_dirs=1 + fi + if [ $copy_always -eq 1 ]; then echo 'X' + elif [ $symlink_dirs -eq 1 ]; then + echo '$' else echo '@' fi @@ -109,7 +117,7 @@ show_file() { output=$dest_file:$abs_src_file if [ $SHOW_SIGILS -eq 1 ]; then - sigil=`sigil_for $src_file` + sigil=`sigil_for $src_file "$symlink_dirs_file_globs"` output="$output:$sigil" fi @@ -33,13 +33,18 @@ list dotfiles from the DIR. This can be specified multiple times. show symbols next to each file indicating status information. Supported symbols are .Li @ -which indicates that the file is a symlink, and +which indicates that the file is a symlink, +.Li $ +which indicates it's a symlinked directory, and .Li X -to indicate that the file is a copy. More details on copied files can be -found in -.Xr rcrc 5 , -under the documentation about -.Va COPY_ALWAYS . +to indicate that the file is a copy. More details on copied files and +symlinked directories can be found in +.Xr rcrc 5 +under the documentation on +.Va COPY_ALWAYS +and +.Va SYMLINK_DIRS , +respectively. . .It Fl I Ar excl_pat include the files that match the given pattern. This is applied after |