Merge pull request #257 from erijo/extension
This commit is contained in:
commit
d298b42653
3 changed files with 10 additions and 0 deletions
|
@ -81,6 +81,7 @@ def test_relative_link(runner, paths, yadm_alt):
|
||||||
@pytest.mark.usefixtures('ds1_copy')
|
@pytest.mark.usefixtures('ds1_copy')
|
||||||
@pytest.mark.parametrize('suffix', [
|
@pytest.mark.parametrize('suffix', [
|
||||||
'##default',
|
'##default',
|
||||||
|
'##default,e.txt', '##default,extension.txt',
|
||||||
'##o.$tst_sys', '##os.$tst_sys',
|
'##o.$tst_sys', '##os.$tst_sys',
|
||||||
'##d.$tst_distro', '##distro.$tst_distro',
|
'##d.$tst_distro', '##distro.$tst_distro',
|
||||||
'##c.$tst_class', '##class.$tst_class',
|
'##c.$tst_class', '##class.$tst_class',
|
||||||
|
|
4
yadm
4
yadm
|
@ -177,6 +177,10 @@ function score_file() {
|
||||||
label=${field%%.*}
|
label=${field%%.*}
|
||||||
value=${field#*.}
|
value=${field#*.}
|
||||||
[ "$field" = "$label" ] && value="" # when .value is omitted
|
[ "$field" = "$label" ] && value="" # when .value is omitted
|
||||||
|
# extension isn't a condition and doesn't affect the score
|
||||||
|
if [[ "$label" =~ ^(e|extension)$ ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
score=$((score + 1000))
|
score=$((score + 1000))
|
||||||
# default condition
|
# default condition
|
||||||
if [[ "$label" =~ ^(default)$ ]]; then
|
if [[ "$label" =~ ^(default)$ ]]; then
|
||||||
|
|
5
yadm.1
5
yadm.1
|
@ -527,6 +527,11 @@ and trimming off any domain.
|
||||||
.TP
|
.TP
|
||||||
.B default
|
.B default
|
||||||
Valid when no other alternate is valid.
|
Valid when no other alternate is valid.
|
||||||
|
.TP
|
||||||
|
.BR extension , " e
|
||||||
|
A special "condition" that doesn't affect the selection process. Its purpose is
|
||||||
|
instead to allow the alternate file to end with a certain extension to
|
||||||
|
e.g. make editors highlight the content properly.
|
||||||
.LP
|
.LP
|
||||||
|
|
||||||
.BR NOTE :
|
.BR NOTE :
|
||||||
|
|
Loading…
Reference in a new issue