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