File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ gh_toc_get_filename() {
118118gh_toc_app () {
119119 local app_name=" gh-md-toc"
120120
121- if [ " $1 " = ' --help' ]; then
121+ if [ " $1 " = ' --help' ] || [ $# -eq 0 ] ; then
122122 echo " GitHub TOC generator ($app_name ): $gh_toc_version "
123123 echo " "
124124 echo " Usage:"
Original file line number Diff line number Diff line change @@ -87,6 +87,17 @@ load test_helper
8787 assert_equal " ${lines[5]} " " gh-md-toc --version Show help"
8888}
8989
90+ @test " no arguments" {
91+ run $BATS_TEST_DIRNAME /../gh-md-toc
92+ assert_success
93+ assert_equal " ${lines[0]} " " GitHub TOC generator (gh-md-toc): 0.4.0"
94+ assert_equal " ${lines[1]} " " Usage:"
95+ assert_equal " ${lines[2]} " " gh-md-toc src [src] Create TOC for a README file (url or local path)"
96+ assert_equal " ${lines[3]} " " gh-md-toc - Create TOC for markdown from STDIN"
97+ assert_equal " ${lines[4]} " " gh-md-toc --help Show help"
98+ assert_equal " ${lines[5]} " " gh-md-toc --version Show help"
99+ }
100+
90101@test " --version" {
91102 run $BATS_TEST_DIRNAME /../gh-md-toc --version
92103 assert_success
You can’t perform that action at this time.
0 commit comments