CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/freeformsystems/lipsum/master/lib/lipsum.md
accept-ranges: bytes
age: 0
date: Wed, 30 Jul 2025 06:09:21 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210092-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753855761.533027,VS0,VE1192
vary: Accept-Encoding
x-fastly-request-id: d59953b295b3f3a18afd261c645fd5636e5b8836
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"971216d4f1d1995f61874c5e9a73195d6ee9c78bfd6e930e4f7eecfb9000294d"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 355D:3A5D35:2232B2:5141A6:6889B711
content-encoding: gzip
accept-ranges: bytes
date: Wed, 30 Jul 2025 06:09:22 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210031-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753855762.792784,VS0,VE254
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 2f98b363ac354670142ee536225dc146cbf56adb
expires: Wed, 30 Jul 2025 06:14:22 GMT
source-age: 0
content-length: 1354
$0
==
Canonical example for the command module.
Generates lorem ipsum text and is used to test help output for the command module.
If the `${opt_latin_pipe}` option is specified and it looks like latin then it does nothing, other more meaningful options that have an affect are interspersed, try `${opt_align_long}` and `${opt_format_long}` in particular. The examples are valid, they illustrate some of the functionality of the command module.
When invoked without arguments the program will print some lorem ipsum paragraphs.
## Commands
* `print, p`: Print some messages using the log middleware
* `ex, exception, e`: Throw an exception
## Options
* `-l, --latin`: Include mock lipsum options and commands.
* `-j, --json`: Print help as json.
* `-c, --collapse`: Collapse whitespace between sections.
* `-v, --vanilla`: Disable parameter replacement.
* `-e, --exit`: Include exit section from error definitions.
* `-s, --sort [value]`: Alters the help option sort order. Set to null to use natural order which is likely the order that options were declared in however this is not guaranteed. Use false for the default sorting logic which favours options with more names, use true to sort lexicographically using *Array.prototype.sort*. Use 1 to sort by option string length (determined by the length of the help option string), reverse the order with -1.
* `-f, --format [value]`: Set the help output format.
* `-a, --align [value]`: Alignment style.
* `-m, --maximum [value]`: Maximum column width.
## Examples
Print help using the command module defaults:
```
$0 ${opt_help_long}
```
Print help and include mock latin options and commands:
```
$0 -lh
```
Print help as JSON:
```
$0 -jh
```
Include exit codes in the help output:
```
$0 -eh
```
Print help as markdown:
```
$0 ${opt_format_long} markdown ${opt_help_long}
```
Switch to flex alignment:
```
$0 -h ${opt_align_long} flex
```
Increase maximum column width:
```
$0 -lh ${opt_maximum_long} 100
```
Disable help option sort (natural order):
```
$0 -lh ${opt_sort_long} null
```
Use default sort order:
```
$0 -lh ${opt_sort_long} false
```
Use lexicographic sort order:
```
$0 -lh ${opt_sort_long} true
```
Sort by length of option (longest first):
```
$0 -lh ${opt_sort_long} 1
```
Sort by length of option (shortest first):
```
$0 -lh ${opt_sort_long} -1
```
Disable terminal colors:
```
$0 ${opt_help_long} ${opt_color_no}
```
Verify ANSI escape sequences are not written to files:
```
$0 ${opt_help_long} > help.txt && cat help.txt
```
Print some messages, illustrates the log middleware:
```
$0 ${cmd_print_long}
```
Set log level to warn and print some messages:
```
$0 ${cmd_print_long} --log-level=warn ${opt_color_no}
```
Print an error, will be treated as an uncaught exception:
```
$0 ex
```
Include stack trace in exception and set log level to trace:
```
$0 ex --debug
```
Verify exit code for uncaught exception, compare to `$0 -eh`:
```
$0 ex; echo $?;
```
## Copyright
Copyright (C) 2014 Freeform Systems, Ltd.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.