Fossil SCM

Add 'glob_match' command to TH1.

mistachkin 2015-05-29 17:20 trunk merge
Commit 62f1f484f6e27ed57a956f9ffa661544e3e06f78
--- src/th_main.c
+++ src/th_main.c
@@ -1324,10 +1324,55 @@
13241324
Th_Trace("[setting %s%#h] => %d<br />\n", strict ? "strict " : "",
13251325
argl[nArg], argv[nArg], rc);
13261326
}
13271327
return rc;
13281328
}
1329
+
1330
+/*
1331
+** TH1 command: glob_match ?-one? ?--? patternList string
1332
+**
1333
+** Checks the string against the specified glob pattern -OR- list of glob
1334
+** patterns and returns non-zero if there is a match.
1335
+*/
1336
+#define GLOB_MATCH_WRONGNUMARGS "glob_match ?-one? ?--? patternList string"
1337
+static int globMatchCmd(
1338
+ Th_Interp *interp,
1339
+ void *p,
1340
+ int argc,
1341
+ const char **argv,
1342
+ int *argl
1343
+){
1344
+ int rc;
1345
+ int one = 0;
1346
+ int nArg = 1;
1347
+ Glob *pGlob = 0;
1348
+ if( argc<3 || argc>5 ){
1349
+ return Th_WrongNumArgs(interp, GLOB_MATCH_WRONGNUMARGS);
1350
+ }
1351
+ if( fossil_strcmp(argv[nArg], "-one")==0 ){
1352
+ one = 1; nArg++;
1353
+ }
1354
+ if( fossil_strcmp(argv[nArg], "--")==0 ) nArg++;
1355
+ if( nArg+2!=argc ){
1356
+ return Th_WrongNumArgs(interp, GLOB_MATCH_WRONGNUMARGS);
1357
+ }
1358
+ if( one ){
1359
+ Th_SetResultInt(interp, sqlite3_strglob(argv[nArg], argv[nArg+1])==0);
1360
+ rc = TH_OK;
1361
+ }else{
1362
+ pGlob = glob_create(argv[nArg]);
1363
+ if( pGlob ){
1364
+ Th_SetResultInt(interp, glob_match(pGlob, argv[nArg+1]));
1365
+ rc = TH_OK;
1366
+ }else{
1367
+ Th_SetResult(interp, "unable to create glob from pattern list", -1);
1368
+ rc = TH_ERROR;
1369
+ }
1370
+ glob_free(pGlob);
1371
+ }
1372
+ return rc;
1373
+}
13291374
13301375
/*
13311376
** TH1 command: regexp ?-nocase? ?--? exp string
13321377
**
13331378
** Checks the string against the specified regular expression and returns
@@ -1553,10 +1598,11 @@
15531598
{"combobox", comboboxCmd, 0},
15541599
{"date", dateCmd, 0},
15551600
{"decorate", wikiCmd, (void*)&aFlags[2]},
15561601
{"enable_output", enableOutputCmd, 0},
15571602
{"getParameter", getParameterCmd, 0},
1603
+ {"glob_match", globMatchCmd, 0},
15581604
{"globalState", globalStateCmd, 0},
15591605
{"httpize", httpizeCmd, 0},
15601606
{"hascap", hascapCmd, (void*)&zeroInt},
15611607
{"hasfeature", hasfeatureCmd, 0},
15621608
{"html", putsCmd, (void*)&aFlags[0]},
15631609
--- src/th_main.c
+++ src/th_main.c
@@ -1324,10 +1324,55 @@
1324 Th_Trace("[setting %s%#h] => %d<br />\n", strict ? "strict " : "",
1325 argl[nArg], argv[nArg], rc);
1326 }
1327 return rc;
1328 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1329
1330 /*
1331 ** TH1 command: regexp ?-nocase? ?--? exp string
1332 **
1333 ** Checks the string against the specified regular expression and returns
@@ -1553,10 +1598,11 @@
1553 {"combobox", comboboxCmd, 0},
1554 {"date", dateCmd, 0},
1555 {"decorate", wikiCmd, (void*)&aFlags[2]},
1556 {"enable_output", enableOutputCmd, 0},
1557 {"getParameter", getParameterCmd, 0},
 
1558 {"globalState", globalStateCmd, 0},
1559 {"httpize", httpizeCmd, 0},
1560 {"hascap", hascapCmd, (void*)&zeroInt},
1561 {"hasfeature", hasfeatureCmd, 0},
1562 {"html", putsCmd, (void*)&aFlags[0]},
1563
--- src/th_main.c
+++ src/th_main.c
@@ -1324,10 +1324,55 @@
1324 Th_Trace("[setting %s%#h] => %d<br />\n", strict ? "strict " : "",
1325 argl[nArg], argv[nArg], rc);
1326 }
1327 return rc;
1328 }
1329
1330 /*
1331 ** TH1 command: glob_match ?-one? ?--? patternList string
1332 **
1333 ** Checks the string against the specified glob pattern -OR- list of glob
1334 ** patterns and returns non-zero if there is a match.
1335 */
1336 #define GLOB_MATCH_WRONGNUMARGS "glob_match ?-one? ?--? patternList string"
1337 static int globMatchCmd(
1338 Th_Interp *interp,
1339 void *p,
1340 int argc,
1341 const char **argv,
1342 int *argl
1343 ){
1344 int rc;
1345 int one = 0;
1346 int nArg = 1;
1347 Glob *pGlob = 0;
1348 if( argc<3 || argc>5 ){
1349 return Th_WrongNumArgs(interp, GLOB_MATCH_WRONGNUMARGS);
1350 }
1351 if( fossil_strcmp(argv[nArg], "-one")==0 ){
1352 one = 1; nArg++;
1353 }
1354 if( fossil_strcmp(argv[nArg], "--")==0 ) nArg++;
1355 if( nArg+2!=argc ){
1356 return Th_WrongNumArgs(interp, GLOB_MATCH_WRONGNUMARGS);
1357 }
1358 if( one ){
1359 Th_SetResultInt(interp, sqlite3_strglob(argv[nArg], argv[nArg+1])==0);
1360 rc = TH_OK;
1361 }else{
1362 pGlob = glob_create(argv[nArg]);
1363 if( pGlob ){
1364 Th_SetResultInt(interp, glob_match(pGlob, argv[nArg+1]));
1365 rc = TH_OK;
1366 }else{
1367 Th_SetResult(interp, "unable to create glob from pattern list", -1);
1368 rc = TH_ERROR;
1369 }
1370 glob_free(pGlob);
1371 }
1372 return rc;
1373 }
1374
1375 /*
1376 ** TH1 command: regexp ?-nocase? ?--? exp string
1377 **
1378 ** Checks the string against the specified regular expression and returns
@@ -1553,10 +1598,11 @@
1598 {"combobox", comboboxCmd, 0},
1599 {"date", dateCmd, 0},
1600 {"decorate", wikiCmd, (void*)&aFlags[2]},
1601 {"enable_output", enableOutputCmd, 0},
1602 {"getParameter", getParameterCmd, 0},
1603 {"glob_match", globMatchCmd, 0},
1604 {"globalState", globalStateCmd, 0},
1605 {"httpize", httpizeCmd, 0},
1606 {"hascap", hascapCmd, (void*)&zeroInt},
1607 {"hasfeature", hasfeatureCmd, 0},
1608 {"html", putsCmd, (void*)&aFlags[0]},
1609
+73 -2
--- test/th1.test
+++ test/th1.test
@@ -857,12 +857,12 @@
857857
# NOTE: This test may fail if the command names do not always come
858858
# out in a deterministic order from TH1.
859859
#
860860
fossil test-th-eval "info commands"
861861
test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
862
-enable_output uplevel http expr utime styleFooter catch if tclReady\
863
-searchable reinitialize combobox lindex query html anoncap randhex\
862
+enable_output uplevel http expr glob_match utime styleFooter catch if\
863
+tclReady searchable reinitialize combobox lindex query html anoncap randhex\
864864
llength for set break regexp styleHeader puts return checkout decorate\
865865
artifact trace wiki proc hascap globalState continue getParameter\
866866
hasfeature setting lsearch breakpoint upvar render repository string unset\
867867
setParameter list error info rename anycap httpize}}
868868
@@ -941,5 +941,76 @@
941941
942942
###############################################################################
943943
944944
fossil test-th-eval "lsearch \"\{aa b c\" a"
945945
test th1-lsearch-10 {$RESULT eq "TH_ERROR: Expected list, got: \"\{aa b c\""}
946
+
947
+###############################################################################
948
+
949
+fossil test-th-eval "glob_match"
950
+test th1-glob-match-1 {$RESULT eq \
951
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
952
+
953
+###############################################################################
954
+
955
+fossil test-th-eval "glob_match -one"
956
+test th1-glob-match-2 {$RESULT eq \
957
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
958
+
959
+###############################################################################
960
+
961
+fossil test-th-eval "glob_match --"
962
+test th1-glob-match-3 {$RESULT eq \
963
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
964
+
965
+###############################################################################
966
+
967
+fossil test-th-eval "glob_match -one --"
968
+test th1-glob-match-4 {$RESULT eq \
969
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
970
+
971
+###############################################################################
972
+
973
+fossil test-th-eval "glob_match -one -- 1"
974
+test th1-glob-match-5 {$RESULT eq \
975
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
976
+
977
+###############################################################################
978
+
979
+fossil test-th-eval "glob_match -one -- 1 2 3"
980
+test th1-glob-match-6 {$RESULT eq \
981
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
982
+
983
+###############################################################################
984
+
985
+fossil test-th-eval {list [glob_match a A] [glob_match A a]}
986
+test th1-glob-match-7 {$RESULT eq "0 0"}
987
+
988
+###############################################################################
989
+
990
+fossil test-th-eval {list [glob_match a,b a] [glob_match a,b b]}
991
+test th1-glob-match-8 {$RESULT eq "1 2"}
992
+
993
+###############################################################################
994
+
995
+fossil test-th-eval {list [glob_match -one a,b a] [glob_match -one a,b b]}
996
+test th1-glob-match-9 {$RESULT eq "0 0"}
997
+
998
+###############################################################################
999
+
1000
+fossil test-th-eval {list [glob_match -one a,b a,b] [glob_match -one a b,a]}
1001
+test th1-glob-match-10 {$RESULT eq "1 0"}
1002
+
1003
+###############################################################################
1004
+
1005
+fossil test-th-eval {list [glob_match a*c abc] [glob_match abc a*c]}
1006
+test th1-glob-match-11 {$RESULT eq "1 0"}
1007
+
1008
+###############################################################################
1009
+
1010
+fossil test-th-eval {list [glob_match a?c abc] [glob_match abc a?c]}
1011
+test th1-glob-match-12 {$RESULT eq "1 0"}
1012
+
1013
+###############################################################################
1014
+
1015
+fossil test-th-eval {list [glob_match {a[bd]c} abc] [glob_match abc {a[bd]c}]}
1016
+test th1-glob-match-13 {$RESULT eq "1 0"}
9461017
--- test/th1.test
+++ test/th1.test
@@ -857,12 +857,12 @@
857 # NOTE: This test may fail if the command names do not always come
858 # out in a deterministic order from TH1.
859 #
860 fossil test-th-eval "info commands"
861 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
862 enable_output uplevel http expr utime styleFooter catch if tclReady\
863 searchable reinitialize combobox lindex query html anoncap randhex\
864 llength for set break regexp styleHeader puts return checkout decorate\
865 artifact trace wiki proc hascap globalState continue getParameter\
866 hasfeature setting lsearch breakpoint upvar render repository string unset\
867 setParameter list error info rename anycap httpize}}
868
@@ -941,5 +941,76 @@
941
942 ###############################################################################
943
944 fossil test-th-eval "lsearch \"\{aa b c\" a"
945 test th1-lsearch-10 {$RESULT eq "TH_ERROR: Expected list, got: \"\{aa b c\""}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
946
--- test/th1.test
+++ test/th1.test
@@ -857,12 +857,12 @@
857 # NOTE: This test may fail if the command names do not always come
858 # out in a deterministic order from TH1.
859 #
860 fossil test-th-eval "info commands"
861 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
862 enable_output uplevel http expr glob_match utime styleFooter catch if\
863 tclReady searchable reinitialize combobox lindex query html anoncap randhex\
864 llength for set break regexp styleHeader puts return checkout decorate\
865 artifact trace wiki proc hascap globalState continue getParameter\
866 hasfeature setting lsearch breakpoint upvar render repository string unset\
867 setParameter list error info rename anycap httpize}}
868
@@ -941,5 +941,76 @@
941
942 ###############################################################################
943
944 fossil test-th-eval "lsearch \"\{aa b c\" a"
945 test th1-lsearch-10 {$RESULT eq "TH_ERROR: Expected list, got: \"\{aa b c\""}
946
947 ###############################################################################
948
949 fossil test-th-eval "glob_match"
950 test th1-glob-match-1 {$RESULT eq \
951 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
952
953 ###############################################################################
954
955 fossil test-th-eval "glob_match -one"
956 test th1-glob-match-2 {$RESULT eq \
957 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
958
959 ###############################################################################
960
961 fossil test-th-eval "glob_match --"
962 test th1-glob-match-3 {$RESULT eq \
963 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
964
965 ###############################################################################
966
967 fossil test-th-eval "glob_match -one --"
968 test th1-glob-match-4 {$RESULT eq \
969 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
970
971 ###############################################################################
972
973 fossil test-th-eval "glob_match -one -- 1"
974 test th1-glob-match-5 {$RESULT eq \
975 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
976
977 ###############################################################################
978
979 fossil test-th-eval "glob_match -one -- 1 2 3"
980 test th1-glob-match-6 {$RESULT eq \
981 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
982
983 ###############################################################################
984
985 fossil test-th-eval {list [glob_match a A] [glob_match A a]}
986 test th1-glob-match-7 {$RESULT eq "0 0"}
987
988 ###############################################################################
989
990 fossil test-th-eval {list [glob_match a,b a] [glob_match a,b b]}
991 test th1-glob-match-8 {$RESULT eq "1 2"}
992
993 ###############################################################################
994
995 fossil test-th-eval {list [glob_match -one a,b a] [glob_match -one a,b b]}
996 test th1-glob-match-9 {$RESULT eq "0 0"}
997
998 ###############################################################################
999
1000 fossil test-th-eval {list [glob_match -one a,b a,b] [glob_match -one a b,a]}
1001 test th1-glob-match-10 {$RESULT eq "1 0"}
1002
1003 ###############################################################################
1004
1005 fossil test-th-eval {list [glob_match a*c abc] [glob_match abc a*c]}
1006 test th1-glob-match-11 {$RESULT eq "1 0"}
1007
1008 ###############################################################################
1009
1010 fossil test-th-eval {list [glob_match a?c abc] [glob_match abc a?c]}
1011 test th1-glob-match-12 {$RESULT eq "1 0"}
1012
1013 ###############################################################################
1014
1015 fossil test-th-eval {list [glob_match {a[bd]c} abc] [glob_match abc {a[bd]c}]}
1016 test th1-glob-match-13 {$RESULT eq "1 0"}
1017
+73 -2
--- test/th1.test
+++ test/th1.test
@@ -857,12 +857,12 @@
857857
# NOTE: This test may fail if the command names do not always come
858858
# out in a deterministic order from TH1.
859859
#
860860
fossil test-th-eval "info commands"
861861
test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
862
-enable_output uplevel http expr utime styleFooter catch if tclReady\
863
-searchable reinitialize combobox lindex query html anoncap randhex\
862
+enable_output uplevel http expr glob_match utime styleFooter catch if\
863
+tclReady searchable reinitialize combobox lindex query html anoncap randhex\
864864
llength for set break regexp styleHeader puts return checkout decorate\
865865
artifact trace wiki proc hascap globalState continue getParameter\
866866
hasfeature setting lsearch breakpoint upvar render repository string unset\
867867
setParameter list error info rename anycap httpize}}
868868
@@ -941,5 +941,76 @@
941941
942942
###############################################################################
943943
944944
fossil test-th-eval "lsearch \"\{aa b c\" a"
945945
test th1-lsearch-10 {$RESULT eq "TH_ERROR: Expected list, got: \"\{aa b c\""}
946
+
947
+###############################################################################
948
+
949
+fossil test-th-eval "glob_match"
950
+test th1-glob-match-1 {$RESULT eq \
951
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
952
+
953
+###############################################################################
954
+
955
+fossil test-th-eval "glob_match -one"
956
+test th1-glob-match-2 {$RESULT eq \
957
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
958
+
959
+###############################################################################
960
+
961
+fossil test-th-eval "glob_match --"
962
+test th1-glob-match-3 {$RESULT eq \
963
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
964
+
965
+###############################################################################
966
+
967
+fossil test-th-eval "glob_match -one --"
968
+test th1-glob-match-4 {$RESULT eq \
969
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
970
+
971
+###############################################################################
972
+
973
+fossil test-th-eval "glob_match -one -- 1"
974
+test th1-glob-match-5 {$RESULT eq \
975
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
976
+
977
+###############################################################################
978
+
979
+fossil test-th-eval "glob_match -one -- 1 2 3"
980
+test th1-glob-match-6 {$RESULT eq \
981
+{TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
982
+
983
+###############################################################################
984
+
985
+fossil test-th-eval {list [glob_match a A] [glob_match A a]}
986
+test th1-glob-match-7 {$RESULT eq "0 0"}
987
+
988
+###############################################################################
989
+
990
+fossil test-th-eval {list [glob_match a,b a] [glob_match a,b b]}
991
+test th1-glob-match-8 {$RESULT eq "1 2"}
992
+
993
+###############################################################################
994
+
995
+fossil test-th-eval {list [glob_match -one a,b a] [glob_match -one a,b b]}
996
+test th1-glob-match-9 {$RESULT eq "0 0"}
997
+
998
+###############################################################################
999
+
1000
+fossil test-th-eval {list [glob_match -one a,b a,b] [glob_match -one a b,a]}
1001
+test th1-glob-match-10 {$RESULT eq "1 0"}
1002
+
1003
+###############################################################################
1004
+
1005
+fossil test-th-eval {list [glob_match a*c abc] [glob_match abc a*c]}
1006
+test th1-glob-match-11 {$RESULT eq "1 0"}
1007
+
1008
+###############################################################################
1009
+
1010
+fossil test-th-eval {list [glob_match a?c abc] [glob_match abc a?c]}
1011
+test th1-glob-match-12 {$RESULT eq "1 0"}
1012
+
1013
+###############################################################################
1014
+
1015
+fossil test-th-eval {list [glob_match {a[bd]c} abc] [glob_match abc {a[bd]c}]}
1016
+test th1-glob-match-13 {$RESULT eq "1 0"}
9461017
--- test/th1.test
+++ test/th1.test
@@ -857,12 +857,12 @@
857 # NOTE: This test may fail if the command names do not always come
858 # out in a deterministic order from TH1.
859 #
860 fossil test-th-eval "info commands"
861 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
862 enable_output uplevel http expr utime styleFooter catch if tclReady\
863 searchable reinitialize combobox lindex query html anoncap randhex\
864 llength for set break regexp styleHeader puts return checkout decorate\
865 artifact trace wiki proc hascap globalState continue getParameter\
866 hasfeature setting lsearch breakpoint upvar render repository string unset\
867 setParameter list error info rename anycap httpize}}
868
@@ -941,5 +941,76 @@
941
942 ###############################################################################
943
944 fossil test-th-eval "lsearch \"\{aa b c\" a"
945 test th1-lsearch-10 {$RESULT eq "TH_ERROR: Expected list, got: \"\{aa b c\""}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
946
--- test/th1.test
+++ test/th1.test
@@ -857,12 +857,12 @@
857 # NOTE: This test may fail if the command names do not always come
858 # out in a deterministic order from TH1.
859 #
860 fossil test-th-eval "info commands"
861 test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\
862 enable_output uplevel http expr glob_match utime styleFooter catch if\
863 tclReady searchable reinitialize combobox lindex query html anoncap randhex\
864 llength for set break regexp styleHeader puts return checkout decorate\
865 artifact trace wiki proc hascap globalState continue getParameter\
866 hasfeature setting lsearch breakpoint upvar render repository string unset\
867 setParameter list error info rename anycap httpize}}
868
@@ -941,5 +941,76 @@
941
942 ###############################################################################
943
944 fossil test-th-eval "lsearch \"\{aa b c\" a"
945 test th1-lsearch-10 {$RESULT eq "TH_ERROR: Expected list, got: \"\{aa b c\""}
946
947 ###############################################################################
948
949 fossil test-th-eval "glob_match"
950 test th1-glob-match-1 {$RESULT eq \
951 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
952
953 ###############################################################################
954
955 fossil test-th-eval "glob_match -one"
956 test th1-glob-match-2 {$RESULT eq \
957 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
958
959 ###############################################################################
960
961 fossil test-th-eval "glob_match --"
962 test th1-glob-match-3 {$RESULT eq \
963 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
964
965 ###############################################################################
966
967 fossil test-th-eval "glob_match -one --"
968 test th1-glob-match-4 {$RESULT eq \
969 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
970
971 ###############################################################################
972
973 fossil test-th-eval "glob_match -one -- 1"
974 test th1-glob-match-5 {$RESULT eq \
975 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
976
977 ###############################################################################
978
979 fossil test-th-eval "glob_match -one -- 1 2 3"
980 test th1-glob-match-6 {$RESULT eq \
981 {TH_ERROR: wrong # args: should be "glob_match ?-one? ?--? patternList string"}}
982
983 ###############################################################################
984
985 fossil test-th-eval {list [glob_match a A] [glob_match A a]}
986 test th1-glob-match-7 {$RESULT eq "0 0"}
987
988 ###############################################################################
989
990 fossil test-th-eval {list [glob_match a,b a] [glob_match a,b b]}
991 test th1-glob-match-8 {$RESULT eq "1 2"}
992
993 ###############################################################################
994
995 fossil test-th-eval {list [glob_match -one a,b a] [glob_match -one a,b b]}
996 test th1-glob-match-9 {$RESULT eq "0 0"}
997
998 ###############################################################################
999
1000 fossil test-th-eval {list [glob_match -one a,b a,b] [glob_match -one a b,a]}
1001 test th1-glob-match-10 {$RESULT eq "1 0"}
1002
1003 ###############################################################################
1004
1005 fossil test-th-eval {list [glob_match a*c abc] [glob_match abc a*c]}
1006 test th1-glob-match-11 {$RESULT eq "1 0"}
1007
1008 ###############################################################################
1009
1010 fossil test-th-eval {list [glob_match a?c abc] [glob_match abc a?c]}
1011 test th1-glob-match-12 {$RESULT eq "1 0"}
1012
1013 ###############################################################################
1014
1015 fossil test-th-eval {list [glob_match {a[bd]c} abc] [glob_match abc {a[bd]c}]}
1016 test th1-glob-match-13 {$RESULT eq "1 0"}
1017
+9
--- www/th1.md
+++ www/th1.md
@@ -130,10 +130,11 @@
130130
* combobox
131131
* date
132132
* decorate
133133
* enable_output
134134
* getParameter
135
+ * glob_match
135136
* globalState
136137
* hascap
137138
* hasfeature
138139
* html
139140
* htmlize
@@ -245,10 +246,18 @@
245246
* getParameter NAME ?DEFAULT?
246247
247248
Returns the value of the specified query parameter or the specified
248249
default value when there is no matching query parameter.
249250
251
+<a name="glob_match"></a>TH1 glob_match Command
252
+-----------------------------------------------
253
+
254
+ * glob_match ?-one? ?--? patternList string
255
+
256
+Checks the string against the specified glob pattern -OR- list of glob
257
+patterns and returns non-zero if there is a match.
258
+
250259
<a name="globalState"></a>TH1 globalState Command
251260
-------------------------------------------------
252261
253262
* globalState NAME ?DEFAULT?
254263
255264
--- www/th1.md
+++ www/th1.md
@@ -130,10 +130,11 @@
130 * combobox
131 * date
132 * decorate
133 * enable_output
134 * getParameter
 
135 * globalState
136 * hascap
137 * hasfeature
138 * html
139 * htmlize
@@ -245,10 +246,18 @@
245 * getParameter NAME ?DEFAULT?
246
247 Returns the value of the specified query parameter or the specified
248 default value when there is no matching query parameter.
249
 
 
 
 
 
 
 
 
250 <a name="globalState"></a>TH1 globalState Command
251 -------------------------------------------------
252
253 * globalState NAME ?DEFAULT?
254
255
--- www/th1.md
+++ www/th1.md
@@ -130,10 +130,11 @@
130 * combobox
131 * date
132 * decorate
133 * enable_output
134 * getParameter
135 * glob_match
136 * globalState
137 * hascap
138 * hasfeature
139 * html
140 * htmlize
@@ -245,10 +246,18 @@
246 * getParameter NAME ?DEFAULT?
247
248 Returns the value of the specified query parameter or the specified
249 default value when there is no matching query parameter.
250
251 <a name="glob_match"></a>TH1 glob_match Command
252 -----------------------------------------------
253
254 * glob_match ?-one? ?--? patternList string
255
256 Checks the string against the specified glob pattern -OR- list of glob
257 patterns and returns non-zero if there is a match.
258
259 <a name="globalState"></a>TH1 globalState Command
260 -------------------------------------------------
261
262 * globalState NAME ?DEFAULT?
263
264
+9
--- www/th1.md
+++ www/th1.md
@@ -130,10 +130,11 @@
130130
* combobox
131131
* date
132132
* decorate
133133
* enable_output
134134
* getParameter
135
+ * glob_match
135136
* globalState
136137
* hascap
137138
* hasfeature
138139
* html
139140
* htmlize
@@ -245,10 +246,18 @@
245246
* getParameter NAME ?DEFAULT?
246247
247248
Returns the value of the specified query parameter or the specified
248249
default value when there is no matching query parameter.
249250
251
+<a name="glob_match"></a>TH1 glob_match Command
252
+-----------------------------------------------
253
+
254
+ * glob_match ?-one? ?--? patternList string
255
+
256
+Checks the string against the specified glob pattern -OR- list of glob
257
+patterns and returns non-zero if there is a match.
258
+
250259
<a name="globalState"></a>TH1 globalState Command
251260
-------------------------------------------------
252261
253262
* globalState NAME ?DEFAULT?
254263
255264
--- www/th1.md
+++ www/th1.md
@@ -130,10 +130,11 @@
130 * combobox
131 * date
132 * decorate
133 * enable_output
134 * getParameter
 
135 * globalState
136 * hascap
137 * hasfeature
138 * html
139 * htmlize
@@ -245,10 +246,18 @@
245 * getParameter NAME ?DEFAULT?
246
247 Returns the value of the specified query parameter or the specified
248 default value when there is no matching query parameter.
249
 
 
 
 
 
 
 
 
250 <a name="globalState"></a>TH1 globalState Command
251 -------------------------------------------------
252
253 * globalState NAME ?DEFAULT?
254
255
--- www/th1.md
+++ www/th1.md
@@ -130,10 +130,11 @@
130 * combobox
131 * date
132 * decorate
133 * enable_output
134 * getParameter
135 * glob_match
136 * globalState
137 * hascap
138 * hasfeature
139 * html
140 * htmlize
@@ -245,10 +246,18 @@
246 * getParameter NAME ?DEFAULT?
247
248 Returns the value of the specified query parameter or the specified
249 default value when there is no matching query parameter.
250
251 <a name="glob_match"></a>TH1 glob_match Command
252 -----------------------------------------------
253
254 * glob_match ?-one? ?--? patternList string
255
256 Checks the string against the specified glob pattern -OR- list of glob
257 patterns and returns non-zero if there is a match.
258
259 <a name="globalState"></a>TH1 globalState Command
260 -------------------------------------------------
261
262 * globalState NAME ?DEFAULT?
263
264

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button