diff options
author | Joe Robinson <joe@lc8n.com> | 2015-12-07 00:13:06 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2015-12-07 00:13:06 +0000 |
commit | 3a0e05950740c89b608b3bf96b71fccba6fd3167 (patch) | |
tree | 3e4df1936385d48fd9306533d8a9f57c34b667f2 | |
parent | 33431d562ef7cc43834c65a66ba9365370c9a968 (diff) |
Add help and version options
-rw-r--r-- | search.php | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,5 +1,7 @@ <?php + $version = 1.2 + $config = false; try { if (!is_readable("config.ini")) { @@ -30,6 +32,15 @@ try { $args = explode(" ", $search); $page = 1; + if (args[0] == "-v" || args[0] == "--version") { + echo $version + \n; + die(); + } else if (args[0] == "-h" || args[0] == "--help") { + echo "Usage: !blaup [query] #[page] | e.g: !blaup intense | !blaup intense marcus | " + echo "!blaup intense marcus #2 (returns the second page of results)\n" + die(); + } + // Check to see if user specified pagination $pages = array_filter($args, function($elem) { if (strpos($elem, "#") === 0) { |