Utils/echo.ps1

Register-GnuUtil @{
    Name         = 'echo'
    Category     = 'Shell helpers'
    Synopsis     = 'Display a line of text.'
    Usage        = @('echo [SHORT-OPTION]... [STRING]...', 'echo LONG-OPTION')
    Description  = @('Echo the STRING(s) to standard output.')
    RawArguments = $true
    Options      = @(
        @{ Short = 'n'; Help = 'do not output the trailing newline' }
        @{ Short = 'e'; Help = 'enable interpretation of backslash escapes' }
        @{ Short = 'E'; Help = 'disable interpretation of backslash escapes (default)' }
    )
    Notes        = @(
        'If -e is in effect, the following sequences are recognized:',
        '',
        ' \\ backslash',
        ' \a alert (BEL)',
        ' \b backspace',
        ' \c produce no further output',
        ' \e escape',
        ' \f form feed',
        ' \n new line',
        ' \r carriage return',
        ' \t horizontal tab',
        ' \v vertical tab',
        ' \0NNN byte with octal value NNN (1 to 3 digits)',
        ' \xHH byte with hexadecimal value HH (1 to 2 digits)',
        '',
        'Options are only recognized before the first STRING, and only if every character is n, e or E.',
        'PowerShell note: the output is a stream of lines; -n cannot suppress the console newline.'
    )
}