diff options
Diffstat (limited to 'kate/data/list-keywords-ldif.awk')
-rw-r--r-- | kate/data/list-keywords-ldif.awk | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/kate/data/list-keywords-ldif.awk b/kate/data/list-keywords-ldif.awk new file mode 100644 index 000000000..fc693c3c3 --- /dev/null +++ b/kate/data/list-keywords-ldif.awk @@ -0,0 +1,38 @@ +#!/bin/awk -f + +function printName (name) +{ + if ((name != "") && (name != "(") && (name != ")")) print type, name; +} + +function printNames (str) +{ + s = substr(str,index(str,"NAME")+4); + split (s, a, " "); +# for (i=0; i<length(a); i++) { +# print type,a[i] +# } + # ATTENTION: The loop above does not work for some strange reason. + # The following statements imitate it for a limited amount of elements. + # If you happen to have more then the ones given here, you have to extend it! + printName(a[0]); + printName(a[1]); + printName(a[2]); + printName(a[3]); +} + +BEGIN { + type=""; +} + +/attributetype/ { + type="attributetype"; +} + +/objectclass/ { + type="objectclass"; +} + +/ NAME / { + printNames($0); +} |