Mercurial > projects > pwm
diff pwm.1.xml @ 27:722a45b4028b
Add define command for defining macros
Macros are parsed when they are defined with the D command and can
subsequently be used as arguments for other commands.
Handle out of memory errors directly in tok.c.
author | Guido Berhoerster <guido+pwm@berhoerster.name> |
---|---|
date | Mon, 25 Sep 2017 21:21:25 +0200 |
parents | 5bdea77d0c1d |
children | e3db02d7f1f4 |
line wrap: on
line diff
--- a/pwm.1.xml Thu Sep 21 09:45:59 2017 +0200 +++ b/pwm.1.xml Mon Sep 25 21:21:25 2017 +0200 @@ -34,7 +34,7 @@ <email>guido+pwm@berhoerster.name</email> <personblurb/> </author> - <date>17 September, 2017</date> + <date>25 September, 2017</date> </info> <refmeta> <refentrytitle>pwm</refentrytitle> @@ -482,6 +482,34 @@ </listitem> </varlistentry> <varlistentry> + <term>Define macro</term> + <listitem> + <cmdsynopsis> + <command>define</command> + <arg choice="plain"> + <replaceable>name</replaceable>=<replaceable>value</replaceable> + </arg> + </cmdsynopsis> + <cmdsynopsis> + <command>D</command> + <arg choice="plain"> + <replaceable>name</replaceable>=<replaceable>value</replaceable> + </arg> + <sbr/> + </cmdsynopsis> + <para>Define the macro <replaceable>name</replaceable> to expand to + <replaceable>value</replaceable>. A Macro is a shorthand term for + a command and/or command arguments. Macros are tokenized when they + are defined, thus if a macro contains other macros, these other + macros are expanded once at the time the macro is defined and not + each time a macro is expanded later. A macro can be used as like a + command or as part of the command's argument by prefixing the macro + name by a "$". It is expanded by substituting the + previously tokenized contents before the command is + evaluated.</para> + </listitem> + </varlistentry> + <varlistentry> <term>Display help text</term> <listitem> <cmdsynopsis>