From 7ebb601a10eb7fdcb533d4f4ca837d97d27f484a Mon Sep 17 00:00:00 2001 From: Ben Klein Date: Wed, 31 Jan 2018 18:32:00 -0500 Subject: [PATCH] Add use_globs to readme --- README.md | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1d6e938..e5a58b2 100644 --- a/README.md +++ b/README.md @@ -165,17 +165,22 @@ files if necessary. Environment variables in paths are automatically expanded. Link commands are specified as a dictionary mapping targets to source locations. Source locations are specified relative to the base directory (that -is specified when running the installer). Directory names should *not* contain -a trailing "/" character. +is specified when running the installer). If linking directories, *do not* include a trailing slash. Link commands support an (optional) extended configuration. In this type of configuration, instead of specifying source locations directly, targets are -mapped to extended configuration dictionaries. These dictionaries map `path` to -the source path, specify `create` as `true` if the parent directory should be -created if necessary, specify `relink` as `true` if incorrect symbolic links -should be automatically overwritten, specify `force` as `true` if the file or -directory should be forcibly linked, and specify `relative` as `true` if the -symbolic link should have a relative path. +mapped to extended configuration dictionaries. + +Available extended configuration parameters: + +| Link Option | Explanation | +| -- | -- | +| `path` | The target for the symlink, the same as in the shortcut syntax (default:null, automatic (see below)) | +| `create` | When true, create parent directories to the link as needed. (default:false) | +| `relink` | Removes the old target if it's a symlink (default:false) | +| `force` | Force removes the old target, file or folder, and forces a new link (default:false) | +| `relative` | Use a relative path when creating the symlink (default:false, absolute links) | +| `use_glob` | Treat a `*` character as a wildcard, and perform link operations on all of those matches (default:false) | #### Example @@ -207,6 +212,10 @@ the following three config files equivalent: ~/.zshrc: force: true path: zshrc + ~/.config/: + use_glob: true + path: config/* + relink: true ``` ```yaml @@ -217,6 +226,10 @@ the following three config files equivalent: relink: true ~/.zshrc: force: true + ~/.config/: + use_glob: true + path: config/* + relink: true ``` ```json @@ -230,6 +243,11 @@ the following three config files equivalent: }, "~/.zshrc": { "force": true + }, + "~/.config/": { + "use_glob": true, + "path": "config/*", + "relink": true } } }