1Heyu Webhook Information
2-------------------------
3Heyu's webhook command allows information about Heyu's configuration to be
4displayed in a variety of user-defined formats which will hopefully
5be useful for writers of web interfaces and other front end software for
6Heyu.
7
8Usage: heyu webhook <option> -L[fmt] -d|D[fmt] -m|M[fmt] -b[fmt] -ce[list] -nb<path> [category]
9
10Options:
11  pathinfo      Display pathspecs for Heyu config and log files.
12  helpinfo      Display available help menu commands
13  config_dump   Display display configuration file directives.
14  flaginfo      Display flags, czflags, or tzflags as long ASCII bitmap.
15  flagbankinfo  Display flags, czflags, or tzflags as multiple banks of 32.
16  maskinfo      Display masks for environment variable X10_Hu
17  flagmaskinfo  Display masks for environment variable X10_Hu_vFlags
18  fileinfo      Deprecated - use pathinfo
19  menuinfo      Deprecated - use helpinfo
20
21Switches:
22  -L         Prefix with formatted line number in configuration file.
23  -d |-D     Display formatted directive label in lower | upper case.
24  -m |-M     Format multiple directive label numbering beginning with 0 | 1
25  -b         Format body of directive.
26  -ce<list>  Characters in <list> are escaped in SCRIPT command lines.
27  -nb<path>  Substitute <path> for logfile path if none defined.
28
29The format specification %V must appear once in each format string ([fmt]),
30where it will be replaced as appropriate by the line number, directive label,
31label number, or directive body.
32
33Categories for config_dump:
34  alias
35  usersyn
36  scene
37  script
38  other    (Everything other than the above directives.)
39  <blank>  (Everything).
40
41Categories for pathinfo:
42  conf     Pathspec for Heyu configuration file
43  log      Pathspec for Heyu log file.
44  <blank>  Both of the above;
45
46Categories for flaginfo and flagbankinfo:
47  flags    Common flags.
48  czflags  Counter-zero flags
49  tzflags  Timer-zero flags
50
51The "helpinfo" option displays the individual help menus available,
52which will vary according to the Configure options selected when
53Heyu is compiled.  The help menues will only be of interest for an
54interface which provides a Heyu command line.
55
56The switches can define a format for each of the parts of a directive
57in the configuration file.  Without a format suffix, the switches have
58a default format.  Each defined switch format must contain the symbol
59%V which is replaced at output by the particular part of the directive.
60Note: Format characters which have special meaning to the shell have to
61be escaped, e.g., '"', '$', '(', ')', and probably others.
62
63If no switches are specified, the directive is displayed as the directive
64label in lower case followed by a single-blank separated list of the
65other tokens in the directive as they appear in the configuration file,
66e.g.,
67  heyu webhook config_dump alias
68yields:
69  alias porch_light A7 StdWS
70
71The -L switch prefixes the line with the line number in the configuration
72file, e.g.,
73  heyu webhook config_dump -L alias
74
75yields with the default format "%V: ":
76  26: alias porch_light A7 StdWS
77
78whereas switch -L%V# would yield:
79  26#alias porch_light A7 StdWS
80
81The -d or -D switch determines the case of the directive label, lower or
82upper respectively.  A format suffix allows the displayed label to be
83expanded, e.g.,
84  heyu webhook config_dump -DHEYU_%V alias
85
86yields:
87  HEYU_ALIAS porch_light A7 StdWS
88
89The -m or -M switch appends a sequential number to the directive label
90for those directives which can appear multiple times in the configuration
91file.  The numbering starts with 0 for -m or with 1 for -M.  These switches
92are ignored for directives which can only appear once, e.g., TTY, in the
93config file. The default format is "[%V]", which for:
94  heyu webhook config_dump -m alias
95
96yields:
97  alias[0] porch_light A7 StdWS
98
99whereas:
100  heyu webhook config_dump -M%V alias
101
102would yield:
103  alias1 porch_light A7 StdWS
104
105The -b switch specifies the format for the body of the directive, i.e., all
106that follows the directive label.  The default is just " %V" (which is the
107same as omitting the switch).  However:
108  heyu webhook config_dump -b" = \"%V\"" alias
109
110yields:
111  alias = "porch_light A7 StdWS"
112
113An exception to the single-blank spacing of tokens is the command line
114tail of a SCRIPT directive.  The command line tail is displayed as-is
115since the spaces may be significant.  But certain characters in the
116command line may need to be escaped to avoid conflict with the body
117format.
118
119The -ce<list> switch ("command-line escape") will result in each
120command line character in the <list> suffix to be escaped.  E.g.,
121for the directive:
122  script a7 on :: echo "Porch Light has been turned ON"
123
124Executing:
125  heyu webhook config_dump -b" = \"%V\"" -ce"\""
126
127yields
128  script = "a7 on :: echo \"Porch Light has been turned ON\""
129
130Example:
131  heyu webhook config_dump -L"%V: " -dheyu_%V -m\(%V\) -b=\"%V\" alias
132
133yields:
134 13: heyu_alias(2)="porch_light A7 StdWS"
135
136The -nb<path> switch ("null body") substitutes <path> for the logfile
137path when directive LOG_DIR is omitted from the configuration file and
138the default logfile path "/dev/null" may be difficult to deal with.
139
140The options fileinfo and menuinfo were provided for a specific PHP
141script.  They exist for backward compatibility but are deprecated.
142They can be replaced by pathinfo and helpinfo as follows:
143For fileinfo, use:
144  heyu webhook pathinfo -d\$heyu_%V -b"=\"%V\";" -nb/tmp/
145For menuinfo, use:
146  heyu webhook helpinfo -d\$%V_menu -m[%V] -b"=\"/heyu/help %V\";"
147
148Notes:
149Obsolete configuration directives are omitted from config_dump.
150(Heyu displays a warning message when they are encountered in the
151configuration file.)
152
153The syntax for aliases in Heyu version 1 used no ALIAS directive,
154merely a line with the alias label, housecode, and unit.  While this
155syntax is still supported in Heyu version 2, config_dump will not
156include these aliases in the alias category.
157
158
159