Skip to content

Commit 2c0f857

Browse files
committed
echo-help: fix typos and document exclamation
1 parent aa01426 commit 2c0f857

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

commands/echo-help

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function echo_help_test() (
44
source "$DOROTHY/sources/bash.bash"
55

66
# if there is invalid syntax, then the status won't be 0
7+
# @todo automate this to `fixtures/` instead of manual review
78
eval-tester --ignore-stderr -- echo-help 'first argument' --blue='second argument' <<-EOF
89
This <bold> should be bold.
910
This [dim] should be dim.
@@ -50,6 +51,10 @@ function echo_help_test() (
5051
\`printf '%s\n' 'sup'; printf 'a\nb\nc'
5152
echo-clear-lines -- \$'a\\nb\\nc'\`
5253
54+
An important note:
55+
! my important note.
56+
! my other important note.
57+
5358
Using process substitution:
5459
\`\`\`
5560
printf '%s\n' 'sup'; printf 'a\nb\nc'
@@ -180,6 +185,7 @@ function echo_help() (
180185
Text wrapped in three backticks indicates literal code that ignores the above, e.g. \`\`\`--timeout=<timeout:max|immediate|<seconds>>\`\`\`
181186
A URL wrapped in angled brackets indicates a URL: \`\`\`<https://dorothy.bevry.me>\`\`\` becomes <https://dorothy.bevry.me>
182187
A line that is all capitals with a trailing colon indicates a header, such as the \`ABOUT:\`, \`USAGE:\`, \`OPTIONS:\`, and \`TEMPLATE:\` from earlier.
188+
! A line preceeded by \`! \` will have the exclamation mark styled red. Use this for important notes, such as variable overrides and conflicts.
183189
184190
A line that starts with an asterisk \`*\` indicates a list item, e.g.:
185191
\`\`\`
@@ -212,9 +218,10 @@ function echo_help() (
212218
* If \`thing\`, do that.
213219
* If \`other\`, do this.
214220
215-
Arguments that are passed to \`echo-help\` will become errors that are appended to the bottom. It is will up to you to return the correct exit status.
221+
Exit status will be [22] \`EINVAL 22 Invalid argument\`.
216222
217-
Exit status should typically be: \`return 22 # EINVAL 22 Invalid argument\`
223+
Arguments that are passed to \`echo-help\` will become errors that are appended to the bottom.
224+
If you want a custom error exit status, it is up to you to ignore and return it.
218225
HELPEOF
219226
return 22 # EINVAL 22 Invalid argument
220227
}

0 commit comments

Comments
 (0)