]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
func_cut: Add example to documentation.
authorphoneben <3232963@gmail.com>
Tue, 18 Jul 2023 22:05:15 +0000 (01:05 +0300)
committerAsterisk Development Team <asteriskteam@digium.com>
Wed, 6 Sep 2023 16:46:46 +0000 (16:46 +0000)
This adds an example to the XML documentation clarifying usage
of the CUT function to address a common misusage.

(cherry picked from commit 3e91137404b561aec0b697fb65806e6ff2457287)

funcs/func_cut.c

index f8bc4941ecb2203b6b353c6cdb0acdea66508482..a0d508d575ad243ed68e0e1d9d7d743fe1dbb5dc 100644 (file)
                </syntax>
                <description>
                        <para>Cut out information from a string (<replaceable>varname</replaceable>), based upon a named delimiter.</para>
+                                       <example title="The 'varname' parameter can only accept a variable name, not a variable expression">
+                               exten => s,1,Set(foo=${CUT(bar,,2)}); This is correct syntax
+                               exten => s,2,Set(foo=${CUT(${bar},,2)}); This is invalid syntax (unless bar contains the name of another variable)
+                                       </example>
                </description>
        </function>
  ***/