Skip to content

Commit

Permalink
Made the grep example more amenable to copypasting
Browse files Browse the repository at this point in the history
By dropping whitespace sensitivity in the greps.  Fixes #4.
  • Loading branch information
Lari Rasku committed Dec 10, 2013
1 parent 9f1ddd1 commit 4c8b652
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ Read the help and version messages from standard input::
Parse the help and version messages from script comments and pass them as
command line arguments::

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

0 comments on commit 4c8b652

Please sign in to comment.