Sign in

    printf

    printf command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.1
    License
    Apache-2.0
    Last updated
    8 hours ago
    Downloads
    36

    Dependencies

    #printf for moonx

    Version 0.2.1 behavior is documented here. The support record separates local verification from published MoonX behavior; moonx examples use registry releases.

    Format and print data like printf(1):

    moonx cli/printf '%s=%d\n' answer 42 moonx cli/printf '%5.2f|%-8x|%o\n' 3.14159 255 8 moonx cli/printf '%s\n' one two three # format reused per argument moonx cli/printf '\x41é\n'

    Supported: the escapes \a \b \e \f \n \r \t \v \\ \" \' \NNN \0NNN \xHH\uHHHH \UHHHHHHHH \c (stop output); the conversions %s %c %b %d %i %u %o%x %X %f %e %E %g %G %% with flags -+ 0#, field width, and precision (width and precision accept *). %b interprets escapes in its argument. Numeric arguments accept decimal, 0x hex, leading-0 octal, and 'C for a character code. The format is reused until all arguments are consumed.

    Float conversions use the exact decimal expansion of the double with round-half-even, matching GNU printf digit for digit. Use -- before a FORMAT that starts with -. Invalid numeric prefixes produce the converted prefix plus a diagnostic and status 1; the format is still repeated as needed.

    #Standalone metadata

    Standalone --version prints exactly printf 0.2.1 followed by one newline. Standalone --help starts with Usage: printf, lists both metadata options, and ends with a newline. Both write to stdout, leave stdin unread, and exit with status 0. Exact-version publication and verification remain recorded separately in the support record.

    Source Files