summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSBeans <info@kayakporn.com>2013-03-06 12:37:18 +0000
committerSBeans <info@kayakporn.com>2013-03-06 12:37:18 +0000
commit1cb6891a34954d8b4ba1325e6394ebe4ba259162 (patch)
treeea58ecba62178f92f0fad8651c447ff0632c95b3
parentb4a63dacefa993f63aa4c5eaf0c8db4cc33e8b75 (diff)
Updated help. Added --help for -h, --remove for -r etc etc
-rw-r--r--blasource.php10
1 files changed, 8 insertions, 2 deletions
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 <some-string-like-this> <someurl.html> e.g. !source --add(-a) gentoo-portage someurl.html. To view source:just enter a token <like-this-one> or <like this one> 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) <some-string-like-this> <someurl.html> e.g. !source --add(-a) gentoo-portage someurl.html. To view source:just enter a token <like-this-one> or <like this one> 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: