summaryrefslogtreecommitdiff
path: root/blasource.php
diff options
context:
space:
mode:
Diffstat (limited to 'blasource.php')
-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: