Skip to content

Commit 4c8b652

Browse files
author
Lari Rasku
committed
Made the grep example more amenable to copypasting
By dropping whitespace sensitivity in the greps. Fixes #4.
1 parent 9f1ddd1 commit 4c8b652

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,19 @@ Read the help and version messages from standard input::
126126
Parse the help and version messages from script comments and pass them as
127127
command line arguments::
128128

129-
## rock 0.1.0
130-
## Copyright (C) 200X Thomas Light
131-
## License RIT (Robot Institute of Technology)
132-
## This is free software: you are free to change and redistribute it.
133-
## There is NO WARRANTY, to the extent permitted by law.
129+
#? rock 0.1.0
130+
#? Copyright (C) 200X Thomas Light
131+
#? License RIT (Robot Institute of Technology)
132+
#? This is free software: you are free to change and redistribute it.
133+
#? There is NO WARRANTY, to the extent permitted by law.
134134
135-
### Usage: rock [options] <argv>...
136-
###
137-
### --help Show help options.
138-
### --version Print program version.
135+
##? Usage: rock [options] <argv>...
136+
##?
137+
##? --help Show help options.
138+
##? --version Print program version.
139139
140-
help=$(grep "^### " "$0" | cut -c 5-)
141-
version=$(grep "^## " "$0" | cut -c 4-)
140+
help=$(grep "^##?" "$0" | cut -c 5-)
141+
version=$(grep "^#?" "$0" | cut -c 4-)
142142
eval "$(docopts -h "$help" -V "$version" : "$@")"
143143
144144
for arg in "${argv[@]}"; do

0 commit comments

Comments
 (0)