Skip to content

Commit 4a7cdeb

Browse files
committed
Merge pull request neilhwatson#20 from lpefferkorn/master
Updated keywords for 3.5, automation scripts
2 parents 5285146 + 80639fe commit 4a7cdeb

File tree

3 files changed

+80
-57
lines changed

3 files changed

+80
-57
lines changed

syntax/cf3.vim

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -74,66 +74,66 @@ syn region cf3Fold start="{" end="}" transparent fold
7474

7575
syn keyword cf3Type string int real slist ilist rlist
7676

77-
syn keyword cf3BuiltIns accessedbefore accumulated ago and contained
78-
syn keyword cf3BuiltIns canonify concat changedbefore classify contained
79-
syn keyword cf3BuiltIns classmatch countclassesmatching contained
80-
syn keyword cf3BuiltIns countlinesmatching diskfree escape execresult contained
81-
syn keyword cf3BuiltIns fileexists filesexist filesize getenv getfields contained
82-
syn keyword cf3BuiltIns getgid getindices getuid getusers getvalues grep contained
83-
syn keyword cf3BuiltIns groupexists hash hashmatch host2ip ip2host contained
84-
syn keyword cf3BuiltIns hostinnetgroup hostrange hostsseen hubknowledge contained
85-
syn keyword cf3BuiltIns iprange irange isdir isexecutable isgreaterthan contained
86-
syn keyword cf3BuiltIns islessthan islink isnewerthan isplain isvariable contained
87-
syn keyword cf3BuiltIns join lastnode laterthan ldaparray ldaplist contained
88-
syn keyword cf3BuiltIns ldapvalue not now on or parseintarray contained
89-
syn keyword cf3BuiltIns parserealarray parsestringarray parsestringarrayidx contained
90-
syn keyword cf3BuiltIns peers peerleader peerleaders product randomint contained
91-
syn keyword cf3BuiltIns readfile readintarray readintlist readrealarray contained
92-
syn keyword cf3BuiltIns readreallist readstringarray readstringarrayidx contained
93-
syn keyword cf3BuiltIns readstringlist readtcp regarray regcmp regextract contained
94-
syn keyword cf3BuiltIns registryvalue regline reglist regldap remotescalar contained
95-
syn keyword cf3BuiltIns remoteclassesmatching returnszero rrange selectservers contained
96-
syn keyword cf3BuiltIns splayclass splitstring strcmp sum translatepath contained
97-
syn keyword cf3BuiltIns usemodule userexists maplist contained
77+
" The following list may be automatically generated using
78+
" tools/extract_cf3BuiltIns.sh in CFEngine source code directory.
79+
80+
syn keyword cf3BuiltIns accessedbefore accumulated ago and canonify contained
81+
syn keyword cf3BuiltIns changedbefore classesmatching classify classmatch concat countclassesmatching contained
82+
syn keyword cf3BuiltIns countlinesmatching difference dirname diskfree escape every contained
83+
syn keyword cf3BuiltIns execresult fileexists filesexist filesize filestat filter contained
84+
syn keyword cf3BuiltIns format getenv getfields getgid getindices getuid contained
85+
syn keyword cf3BuiltIns getusers getvalues grep groupexists hash hashmatch contained
86+
syn keyword cf3BuiltIns host2ip hostinnetgroup hostrange hostsseen hostswithclass hubknowledge contained
87+
syn keyword cf3BuiltIns ifelse innetgroup intersection ip2host iprange irange contained
88+
syn keyword cf3BuiltIns isdir isexecutable isgreaterthan islessthan islink isnewerthan contained
89+
syn keyword cf3BuiltIns isplain isvariable join lastnode laterthan ldaparray contained
90+
syn keyword cf3BuiltIns ldaplist ldapvalue length lsdir maparray maplist contained
91+
syn keyword cf3BuiltIns none not now nth on or contained
92+
syn keyword cf3BuiltIns parseintarray parserealarray parsestringarray parsestringarrayidx peerleader peerleaders contained
93+
syn keyword cf3BuiltIns peers product randomint readfile readintarray readintlist contained
94+
syn keyword cf3BuiltIns readrealarray readreallist readstringarray readstringarrayidx readstringlist readtcp contained
95+
syn keyword cf3BuiltIns regarray regcmp regextract registryvalue regldap regline contained
96+
syn keyword cf3BuiltIns reglist remoteclassesmatching remotescalar returnszero rrange selectservers contained
97+
syn keyword cf3BuiltIns some splayclass splitstring strcmp strftime sublist contained
98+
syn keyword cf3BuiltIns sum translatepath uniq usemodule userexists contained
99+
98100

99101
" Stdlib: -rw-r--r-- 1 ivan staff 59012 Jun 27 18:05
100102
" /Users/ivan/Downloads/cfengine_stdlib.cf
101-
"
102-
syn keyword cf3Stdlib insert_lines insert_file comment_lines_matching uncomment_lines_matching contained
103-
syn keyword cf3Stdlib comment_lines_containing uncomment_lines_containing delete_lines_matching contained
104-
syn keyword cf3Stdlib warn_lines_matching append_if_no_line contained
105-
syn keyword cf3Stdlib append_if_no_lines replace_line_end append_to_line_end regex_replace contained
106-
syn keyword cf3Stdlib resolvconf manage_variable_values_ini contained
107-
syn keyword cf3Stdlib set_variable_values_ini set_variable_values set_config_values contained
108-
syn keyword cf3Stdlib set_config_values_matching maintain_key_values contained
109-
syn keyword cf3Stdlib append_users_starting append_groups_starting set_colon_field contained
110-
syn keyword cf3Stdlib set_user_field append_user_field contained
111-
syn keyword cf3Stdlib expand_template replace_or_add cronjob quoted_var col contained
112-
syn keyword cf3Stdlib line value INI_section std_defs empty contained
113-
syn keyword cf3Stdlib no_backup start after before comment contained
114-
syn keyword cf3Stdlib uncomment if_elapsed if_elapsed_day measure_performance warn_only contained
115-
syn keyword cf3Stdlib bg ifwin_bg immediate policy log_repaired contained
116-
syn keyword cf3Stdlib log_verbose silent in_dir in_dir_shell silent_in_dir contained
117-
syn keyword cf3Stdlib in_shell in_shell_bg in_shell_and_silent in_dir_shell_and_silent setuid contained
118-
syn keyword cf3Stdlib setuid_sh setuidgid_sh jail if_repaired if_else contained
119-
syn keyword cf3Stdlib cf2_if_else if_notkept if_ok if_ok_cancel cmd_repair contained
120-
syn keyword cf3Stdlib state_repaired enumerate always secure_cp remote_cp contained
121-
syn keyword cf3Stdlib remote_dcp local_cp local_dcp perms_cp backup_local_cp contained
122-
syn keyword cf3Stdlib seed_cp sync_cp no_backup_cp no_backup_dcp no_backup_rcp contained
123-
syn keyword cf3Stdlib ln_s linkchildren m mo mog contained
124-
syn keyword cf3Stdlib og owner access_generic ntfs strict contained
125-
syn keyword cf3Stdlib recurse recurse_ignore include_base tidy disable contained
126-
syn keyword cf3Stdlib rotate to name_age days_old size_range contained
127-
syn keyword cf3Stdlib exclude plain dirs by_name ex_list contained
128-
syn keyword cf3Stdlib all detect_all_change detect_content noupdate diff contained
129-
syn keyword cf3Stdlib diff_noupdate zypper apt dpkg_version rpm_version contained
130-
syn keyword cf3Stdlib windows_feature msi_implicit msi_explicit yum yum_rpm contained
131-
syn keyword cf3Stdlib rpm_filebased ips solaris create_solaris_admin_file freebsd contained
132-
syn keyword cf3Stdlib emerge generic min_free_space nfs nfs_p contained
133-
syn keyword cf3Stdlib unmount exclude_procs days_older_than any_count check_range contained
134-
syn keyword cf3Stdlib bootstart force_deps standard_services local_mysql local_postgresql contained
135-
syn keyword cf3Stdlib kvm scan_log scan_changing_file single_value line_match_value contained
136-
syn keyword cf3Stdlib sample_rate contained
103+
104+
" The following list may be automatically generated using
105+
" tools/extract_cf3Stdlib.sh in CFEngine source code directory.
106+
107+
syn keyword cf3Stdlib INI_section access_generic after all all_changes contained
108+
syn keyword cf3Stdlib alpinelinux always any_count append_groups_starting append_if_no_line append_if_no_lines contained
109+
syn keyword cf3Stdlib append_to_line_end append_user_field append_users_starting apt apt_get apt_get_release contained
110+
syn keyword cf3Stdlib backup_local_cp backup_timestamp before bg bootstart by_name contained
111+
syn keyword cf3Stdlib cf2_if_else check_range classes_generic cmd_repair col comment contained
112+
syn keyword cf3Stdlib comment_lines_containing comment_lines_matching create_solaris_admin_file cronjob days_old days_older_than contained
113+
syn keyword cf3Stdlib debian_knowledge delete_lines_matching detect_all_change detect_all_change_using detect_content detect_content_using contained
114+
syn keyword cf3Stdlib diff diff_noupdate dirs disable dpkg_version emerge contained
115+
syn keyword cf3Stdlib empty enumerate ex_list exclude exclude_procs expand_template contained
116+
syn keyword cf3Stdlib fileinfo filetype_older_than filetypes_older_than force_deps freebsd generic contained
117+
syn keyword cf3Stdlib if_elapsed if_elapsed_day if_else if_notkept if_ok if_ok_cancel contained
118+
syn keyword cf3Stdlib if_repaired ifwin_bg immediate in_dir in_dir_shell in_dir_shell_and_silent contained
119+
syn keyword cf3Stdlib in_shell in_shell_and_silent in_shell_bg include_base insert_file insert_lines contained
120+
syn keyword cf3Stdlib ips jail kvm line line_match_value linkchildren contained
121+
syn keyword cf3Stdlib ln_s local_cp local_dcp local_mysql local_postgresql log_repaired contained
122+
syn keyword cf3Stdlib log_verbose m maintain_key_values manage_variable_values_ini measure_performance min_free_space contained
123+
syn keyword cf3Stdlib mo mog msi_explicit msi_implicit name_age nfs contained
124+
syn keyword cf3Stdlib nfs_p no_backup no_backup_cp no_backup_dcp no_backup_rcp noupdate contained
125+
syn keyword cf3Stdlib ntfs og older_than opencsw owner pacman contained
126+
syn keyword cf3Stdlib paths perms_cp plain policy quoted_var recurse contained
127+
syn keyword cf3Stdlib recurse_ignore recurse_with_base regex_replace remote_cp remote_dcp replace_line_end contained
128+
syn keyword cf3Stdlib replace_or_add resolvconf rm_rf rotate rpm_filebased rpm_version contained
129+
syn keyword cf3Stdlib sample_rate scan_changing_file scan_log scoped_classes_generic secure_cp seed_cp contained
130+
syn keyword cf3Stdlib set_colon_field set_config_values set_config_values_matching set_quoted_values set_user_field set_variable_values contained
131+
syn keyword cf3Stdlib set_variable_values_ini setuid setuid_sh setuid_umask setuidgid_sh silent contained
132+
syn keyword cf3Stdlib silent_in_dir single_value size_range smartos solaris standard_services contained
133+
syn keyword cf3Stdlib start state_repaired std_defs strict sync_cp tidy contained
134+
syn keyword cf3Stdlib to uncomment uncomment_lines_containing uncomment_lines_matching unmount value contained
135+
syn keyword cf3Stdlib warn_lines_matching warn_only windows_feature yum yum_group yum_rpm contained
136+
syn keyword cf3Stdlib yum_rpm_enable_repo zypper contained
137137

138138
"syn match cf3Function /\w\+[,;(\>]/ contains=cf3BuiltIns,cf3Stdlib
139139
syn match cf3Function /\<\w\+[,;()]/ contains=cf3BuiltIns,cf3Stdlib

tools/extract_cf3BuiltIns.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# Extract functions from CFEngine documentation. Should be run
4+
# inside CFEngine source code directory:
5+
#
6+
# cd cfengine-3.4.2
7+
# ~/path/to/tools/extract_cf3BuiltIns.sh
8+
9+
find docs/reference/functions -type f -name '*_notes.texinfo' -printf "%f "|\
10+
sed -e 's/_notes.texinfo//g'|\
11+
awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 == 0) printf "MARK";printf "%s ", tab[i]}} END{print "contained"}'|\
12+
sed 's/MARK/contained\nsyn keyword cf3BuiltIns\t/g'|tail -n +2

tools/extract_cf3Stdlib.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# Extract functions from CFEngine stdlib documentation. Should be run
4+
# inside CFEngine source code directory:
5+
#
6+
# cd cfengine-3.4.2
7+
# ~/path/to/tools/extract_cf3Stdlib.sh
8+
9+
awk '/^(bundle|body)/ {gsub(/\(.+/, "", $3);printf " %s", $3}' masterfiles/libraries/cfengine_stdlib.cf |\
10+
sort|awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 ==0) printf "MARK";printf "%s ", tab[i]}} END{ print "contained"}'|\
11+
sed 's/MARK/contained\nsyn keyword cf3Stdlib\t/g'|tail -n +2

0 commit comments

Comments
 (0)