]> git.ipfire.org Git - thirdparty/asterisk.git/commit
xmldoc.c: Fix rendering of CLI output. 20
authorGeorge Joseph <gjoseph@sangoma.com>
Thu, 14 Aug 2025 15:41:45 +0000 (09:41 -0600)
committerGeorge Joseph <gjoseph@sangoma.com>
Fri, 15 Aug 2025 16:48:12 +0000 (16:48 +0000)
commitbd1e723ecac610a0afdce9258dac907f0ca91e40
tree41a733b8582a5162acc5ac7833477aeb9ae7786f
parent00b6ab22a0175c1c4f39e67a40ccccd24d8d12ce
xmldoc.c: Fix rendering of CLI output.

If you do a `core show application Dial`, you'll see it's kind of a mess.
Indents are wrong is some places, examples are printed in black which makes
them invisible on most terminals, and the lack of line breaks in some cases
makes it hard to follow.

* Fixed the rendering of examples so they are indented properly and changed
the color so they can be seen.
* There is now a line break before each option.
* Options are now printed on their own line with all option content indented
below them.

Example from Dial before fixes:
```
    Example: Dial 555-1212 on first available channel in group 1, searching
    from highest to lowest

    Example: Ringing FXS channel 4 with ring cadence 2

    Example: Dial 555-1212 on channel 3 and require answer confirmation

...

    O([mode]):
        mode - With <mode> either not specified or set to '1', the originator
        hanging up will cause the phone to ring back immediately.
 - With <mode> set to '2', when the operator flashes the trunk, it will ring
 their phone back.
Enables *operator services* mode.  This option only works when bridging a DAHDI
channel to another DAHDI channel only. If specified on non-DAHDI interfaces, it
will be ignored. When the destination answers (presumably an operator services
station), the originator no longer has control of their line. They may hang up,
but the switch will not release their line until the destination party (the
operator) hangs up.

    p: This option enables screening mode. This is basically Privacy mode
    without memory.
```

After:
```
    Example: Dial 555-1212 on first available channel in group 1, searching
    from highest to lowest

     same => n,Dial(DAHDI/g1/5551212)

    Example: Ringing FXS channel 4 with ring cadence 2

     same => n,Dial(DAHDI/4r2)

    Example: Dial 555-1212 on channel 3 and require answer confirmation

     same => n,Dial(DAHDI/3c/5551212)

...

    O([mode]):
        mode - With <mode> either not specified or set to '1', the originator
        hanging up will cause the phone to ring back immediately.
        With <mode> set to '2', when the operator flashes the trunk, it will
        ring their phone back.
        Enables *operator services* mode.  This option only works when bridging
        a DAHDI channel to another DAHDI channel only. If specified on
        non-DAHDI interfaces, it will be ignored. When the destination answers
        (presumably an operator services station), the originator no longer has
        control of their line. They may hang up, but the switch will not
        release their line until the destination party (the operator) hangs up.

    p:
        This option enables screening mode. This is basically Privacy mode
        without memory.
```

There are still things we can do to make this more readable but this is a
start.
main/xmldoc.c