From e75c2e31a1419ce8335a8c44908d718ed2d903ed Mon Sep 17 00:00:00 2001 From: AaronYoung5 Date: Sat, 1 Mar 2025 07:57:49 -0500 Subject: [PATCH] Updated docs for negation conditions --- yadm.1 | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/yadm.1 b/yadm.1 index e212a27..69903f3 100644 --- a/yadm.1 +++ b/yadm.1 @@ -475,9 +475,11 @@ commas. Each condition is an attribute/value pair, separated by a period. Some conditions do not require a "value", and in that case, the period and value can -be omitted. Most attributes can be abbreviated as a single letter. +be omitted. Most attributes can be abbreviated as a single letter. Prefixing an +attribute with "~" negates the condition, meaning the condition is considered +only if the attribute/value pair evaluates to false. - [.] + [~][.] .BR NOTE : Value is compared case-insensitive. @@ -552,11 +554,12 @@ For all files managed by yadm's repository or listed in if they match this naming convention, symbolic links will be created for the most appropriate version. -The "most appropriate" version is determined by calculating a score for each -version of a file. A template is always scored higher than any symlink -condition. The number of conditions is the next largest factor in scoring. -Files with more conditions will always be favored. Any invalid condition will -disqualify that file completely. +The "most appropriate" version is determined by calculating a score for each +version of a file. A template is always scored higher than any symlink +condition. The number of conditions is the next largest factor in scoring; +files with more conditions will always be favored. Negative conditions (prefixed +with "~") are scored only relative to the number of non-negated conditions. +Any invalid condition will disqualify that file completely. If you don't care to have all versions of alternates stored in the same directory as the generated symlink, you can place them in the @@ -575,7 +578,7 @@ files are managed by yadm's repository: - $HOME/path/example.txt##os.Linux - $HOME/path/example.txt##os.Linux,hostname.host1 - $HOME/path/example.txt##os.Linux,hostname.host2 - - $HOME/path/example.txt##~os.Linux,~os.Darwin,~os.SunOS + - $HOME/path/example.txt##class.Work,~os.Darwin If running on a Macbook named "host2", yadm will create a symbolic link which looks like this: @@ -598,14 +601,15 @@ If running on a Solaris server, the link will use the default version: .IR $HOME/path/example.txt " -> " $HOME/path/example.txt##default -If running on a system, with class set to "Work", the link will be: +If running on a Macbook with class set to "Work", the link will be: .IR $HOME/path/example.txt " -> " $HOME/path/example.txt##class.Work -Negative conditions are supported via the "~" prefix. If running within -Windows Subsystem for Linux, where the os is reported as WSL, the link will be: +Negative conditions are supported via the "~" prefix. If again running on a system +with class set to "Work", but instead within Windows Subsystem for Linux, where the +os is reported as WSL, the link will be: -.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##~os.Linux,~os.Darwin,~os.SunOS +.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##class.Work,~os.Darwin Negative conditions use the same weight which corresponds to the attached attribute.