@@ -476,9 +476,11 @@ commas.
476476
477477Each condition is an attribute/value pair, separated by a period. Some
478478conditions do not require a "value", and in that case, the period and value can
479- be omitted. Most attributes can be abbreviated as a single letter.
479+ be omitted. Most attributes can be abbreviated as a single letter. Prefixing an
480+ attribute with "~" negates the condition, meaning the condition is considered
481+ only if the attribute/value pair evaluates to false.
480482
481- <attribute>[.<value>]
483+ [~] <attribute>[.<value>]
482484
483485.BR NOTE :
484486Value is compared case-insensitive.
@@ -555,9 +557,10 @@ symbolic links will be created for the most appropriate version.
555557
556558The "most appropriate" version is determined by calculating a score for each
557559version of a file. A template is always scored higher than any symlink
558- condition. The number of conditions is the next largest factor in scoring.
559- Files with more conditions will always be favored. Any invalid condition will
560- disqualify that file completely.
560+ condition. The number of conditions is the next largest factor in scoring;
561+ files with more conditions will always be favored. Negative conditions (prefixed
562+ with "~") are scored only relative to the number of non-negated conditions.
563+ Any invalid condition will disqualify that file completely.
561564
562565If you don't care to have all versions of alternates stored in the same
563566directory as the generated symlink, you can place them in the
@@ -576,6 +579,7 @@ files are managed by yadm's repository:
576579 - $HOME/path/example.txt##os.Linux
577580 - $HOME/path/example.txt##os.Linux,hostname.host1
578581 - $HOME/path/example.txt##os.Linux,hostname.host2
582+ - $HOME/path/example.txt##class.Work,~os.Darwin
579583
580584If running on a Macbook named "host2",
581585yadm will create a symbolic link which looks like this:
@@ -598,10 +602,18 @@ If running on a Solaris server, the link will use the default version:
598602
599603.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##default
600604
601- If running on a system, with class set to "Work", the link will be:
605+ If running on a Macbook with class set to "Work", the link will be:
602606
603607.IR $HOME/path/example.txt " -> " $HOME/path/example.txt##class.Work
604608
609+ Negative conditions are supported via the "~" prefix. If again running on a system
610+ with class set to "Work", but instead within Windows Subsystem for Linux, where the
611+ os is reported as WSL, the link will be:
612+
613+ .IR $HOME/path/example.txt " -> " $HOME/path/example.txt##class.Work,~os.Darwin
614+
615+ Negative conditions use the same weight which corresponds to the attached attribute.
616+
605617If no "##default" version exists and no files have valid conditions, then no
606618link will be created.
607619
0 commit comments