8275fcb12d645b92af7eeb176c522355863856d7
[packages/precise/mcollective.git] / ext / vim / mcollective_ddl.snippets
1 # Snippets for use with VIM and http://www.vim.org/scripts/script.php?script_id=2540
2 #
3 # These snippets help you write Agent DDLs.  Install the VIM Snippets system
4 # and copy this to your snippets directory.
5 #
6 # Create a file .vim/ftdetect/mcollective_ddl.vim with the following:
7 #
8 #   au BufRead,BufNewFile *.ddl   setfiletype mcollective_ddl
9 #
10 # Your file type should now be correctly set automatically and editing
11 # DDLs should be easier.
12 #
13 # Please contact R.I.Pienaar <rip@devco.net> for additions and feedback,
14 snippet meta
15         metadata    :name        => "${1:`Filename('', 'name')`}",
16                     :description => "${2:description}",
17                     :author      => "${3:`g:snips_author`}",
18                     :license     => "${4:license}",
19                     :version     => "${5:version}",
20                     :url         => "${6:homepage}",
21                     :timeout     => ${7:run timeout}
22
23         ${8}
24 snippet discovery
25         discovery do
26                 capabilities ${1:capability list}
27         end
28 snippet dataquery
29         dataquery :description => "${1:data query description}" do
30             ${2}
31         end
32 snippet action
33         action "${1:action name}", :description => "${2:action description}" do
34             ${3}
35         end
36 snippet input String
37         input :${1:input name},
38               :prompt      => "${2:prompt when asking for information}",
39               :description => "${3:description of the input}",
40               :type        => :string,
41               :validation  => '${4:^.+$}',
42               :optional    => ${5:false},
43               :maxlength   => ${6:20}
44
45         ${7}
46 snippet input List
47         input :${1:input name},
48               :prompt      => "${2:prompt when asking for information}",
49               :description => "${3:description of the input}",
50               :type        => :list,
51               :optional    => ${4:false},
52               :list        => [${5:list members}]
53
54         ${6}
55 snippet input Numeric
56         input :${1:input name},
57               :prompt      => "${2:prompt when asking for information}",
58               :description => "${3:description of the input}",
59               :type        => :number,
60               :optional    => ${4:false}
61
62         ${5}
63 snippet input Boolean
64         input :${1:input name},
65               :prompt      => "${2:prompt when asking for information}",
66               :description => "${3:description of the input}",
67               :type        => :boolean,
68               :optional    => ${4:false}
69
70         ${5}
71 snippet output
72         output ${1:output name},
73                :description => "${2:description of this output data}",
74                :display_as  => "${3:what do display}",
75                :default     => ${4:nil}
76
77         ${5}
78 snippet display Always
79         display :always
80
81
82 snippet display Only OK results
83         display :ok
84
85
86 snippet display Only failed results
87         display :failed
88
89