From 4c8b652998a5ffda5068197f002b5ab5735761d6 Mon Sep 17 00:00:00 2001 From: Lari Rasku Date: Tue, 10 Dec 2013 18:30:50 +0200 Subject: [PATCH] Made the grep example more amenable to copypasting By dropping whitespace sensitivity in the greps. Fixes #4. --- README.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index 01c3a1b..c82d592 100644 --- a/README.rst +++ b/README.rst @@ -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] ... - ### - ### --help Show help options. - ### --version Print program version. + ##? Usage: rock [options] ... + ##? + ##? --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