| 1 |
## our_shell: ysh
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
help zz
|
| 6 |
|
| 7 |
## status: 1
|
| 8 |
## STDOUT:
|
| 9 |
## END
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
help > help.txt
|
| 14 |
echo no args $?
|
| 15 |
echo
|
| 16 |
|
| 17 |
for topic in help oils-usage {osh,ysh}-usage {osh,ysh}-chapters; do
|
| 18 |
help $topic | fgrep -o "~~~ $topic"
|
| 19 |
echo $topic $?
|
| 20 |
echo
|
| 21 |
done
|
| 22 |
|
| 23 |
## STDOUT:
|
| 24 |
no args 0
|
| 25 |
|
| 26 |
~~~ help
|
| 27 |
help 0
|
| 28 |
|
| 29 |
~~~ oils-usage
|
| 30 |
oils-usage 0
|
| 31 |
|
| 32 |
~~~ osh-usage
|
| 33 |
osh-usage 0
|
| 34 |
|
| 35 |
~~~ ysh-usage
|
| 36 |
ysh-usage 0
|
| 37 |
|
| 38 |
~~~ osh-chapters
|
| 39 |
osh-chapters 0
|
| 40 |
|
| 41 |
~~~ ysh-chapters
|
| 42 |
ysh-chapters 0
|
| 43 |
|
| 44 |
## END
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
help command-sub | grep -o chap-word-lang.html
|
| 49 |
echo status=$?
|
| 50 |
|
| 51 |
help read | grep -o chap-builtin-cmd.html
|
| 52 |
echo status=$?
|
| 53 |
|
| 54 |
## STDOUT:
|
| 55 |
chap-word-lang.html
|
| 56 |
status=0
|
| 57 |
chap-builtin-cmd.html
|
| 58 |
status=0
|
| 59 |
## END
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
# shows ~~~ instead of ANSI text
|
| 64 |
help | grep ysh-chapters
|
| 65 |
|
| 66 |
echo status=$?
|
| 67 |
|
| 68 |
## STDOUT:
|
| 69 |
~~~ ysh-chapters ~~~
|
| 70 |
status=0
|
| 71 |
## END
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
shopt --set ysh:upgrade
|
| 76 |
|
| 77 |
proc assert-lines {
|
| 78 |
var num_lines = $(@ARGV | wc -l)
|
| 79 |
#echo "lines = $num_lines"
|
| 80 |
if (num_lines < 2) {
|
| 81 |
error "only got $num_lines lines"
|
| 82 |
}
|
| 83 |
}
|
| 84 |
|
| 85 |
assert-lines help List/append
|
| 86 |
echo status=$?
|
| 87 |
|
| 88 |
assert-lines help cmd/append
|
| 89 |
echo status=$?
|
| 90 |
|
| 91 |
assert-lines help runes
|
| 92 |
echo status=$?
|
| 93 |
|
| 94 |
## STDOUT:
|
| 95 |
status=0
|
| 96 |
status=0
|
| 97 |
status=0
|
| 98 |
## END
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
# note that the topics are lower-casedo
|
| 104 |
|
| 105 |
help oils-err-12 | grep -o 'catalog.html#oils-err-12'
|
| 106 |
echo status=$?
|
| 107 |
|
| 108 |
help OILS-ERR-12 | grep -o 'catalog.html#oils-err-12'
|
| 109 |
echo status=$?
|
| 110 |
|
| 111 |
# these are bad
|
| 112 |
|
| 113 |
# help oils-err-zz
|
| 114 |
# echo status=$?
|
| 115 |
|
| 116 |
# help OILS-ERR-zz
|
| 117 |
# echo status=$?
|
| 118 |
|
| 119 |
## STDOUT:
|
| 120 |
catalog.html#oils-err-12
|
| 121 |
status=0
|
| 122 |
catalog.html#oils-err-12
|
| 123 |
status=0
|
| 124 |
## END
|