Comment-Based Help: Are multiple-line examples supported?

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Aaron Jensen Aaron Jensen 2 years, 3 months ago.

  • Author
    Posts
  • #18272
    Profile photo of Aaron Jensen
    Aaron Jensen
    Participant

    Does comment-based help support multiple line examples? It seems the parsers assumes the first line after .EXAMPLE is code, and the rest are remarks, so this:

    .EXAMPLE
    > line1
    > line2

    Demonstrates how to use the command.

    Is output as:

    ————————– EXAMPLE 1 ————————–

    >line1

    > line2

    Note the two lines between line 1 and line 2. Is there anything I can do to tell the comment-based help parser that my code spans multiple lines?

  • #18274
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Nope.

  • #18275
    Profile photo of Aaron Jensen
    Aaron Jensen
    Participant

    Sad trombone. I've requested this feature on Microsoft Connect.

    In the meantime, this is how I've worked around it:

    .EXAMPLE
    >
    Carbon_EnvironmentVariable RemoveCarbonEnv
    {
        Name = 'CARBON_ENV';
        Ensure = 'Absent';
    }
    
    Demonstrates how to remove an environment variable.
    

    I leave the code line blank, and put my code block immediately after. It displays like this:

    - EXAMPLE 1 -
        
    >
        
    Carbon_EnvironmentVariable SetCarbonEnv
    {
        Name = 'CARBON_ENV';
        Value = 'developer';
        Ensure = 'Present';
    }
    
    Demonstrates how to create or update an environment variable.
    

    Which isn't ideal, but works.

You must be logged in to reply to this topic.