From 1cb6891a34954d8b4ba1325e6394ebe4ba259162 Mon Sep 17 00:00:00 2001 From: SBeans Date: Wed, 6 Mar 2013 12:37:18 +0000 Subject: Updated help. Added --help for -h, --remove for -r etc etc --- blasource.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'blasource.php') diff --git a/blasource.php b/blasource.php index 50b55db..49e5447 100644 --- a/blasource.php +++ b/blasource.php @@ -11,8 +11,9 @@ // 0.2.0 Fixed -l so it shows 5 results. Added -c Count added -r remove and updated help // 0.2.1 Fixed -l (showing too many results) and -r (Not showing text of removed line // 0.2.2 Changed -new to --add + // 0.2.3 Updated help added --WORD to all -? parameters. - $version = "BlaSource Version: 0.2.2"; + $version = "BlaSource Version: 0.2.3"; // get the input $stdin = read_stdin(); @@ -24,10 +25,12 @@ switch ($stdin[$i]) { case "-c": + case "--count": //count echo exec("cat blasource.txt | wc -l"); break; case "-r": + case "--remove": if(!isset($stdin[$i+1])) { echo "Please specify the number to remove. [-r X]"; @@ -58,6 +61,7 @@ echo "Removed line " . $lineToRemove . ": " . $stringRemove. "."; break; case "-l": + case "--list": $last = str_replace(":", "",exec("grep -n \"\" blasource.txt | tail -n 1")) / 5 + 1; $page = 0; if(!isset($stdin[$i+1])) @@ -98,11 +102,13 @@ $i = sizeof($stdin); break; case "-v": + case "--version" $out = $version; $i = sizeof($stdin); break; case "-h": - $out = "-h for help, -v for version, -new e.g. !source --add(-a) gentoo-portage someurl.html. To view source:just enter a token or e.g. !source gentoo-portage or !source gentoo portage. -l will list the first page (5 records). -l X will show page X. -c returns count. -r X removes item X."; + case "--help": + $out = "-h|--help for help, -v|--version for version, --add (-a) e.g. !source --add(-a) gentoo-portage someurl.html. To view source:just enter a token or e.g. !source gentoo-portage or !source gentoo portage. -l will list the first page (5 records). -l|--list X will show page X. -c --count returns count. -r --remove X removes item X."; $i = sizeof($stdin); break; default: -- cgit v1.2.3