summaryrefslogtreecommitdiffstats
path: root/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-12-11 01:16:01 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2009-12-11 01:16:20 +0100
commit48d7424647b146a66c5bde93ee836919933a4150 (patch)
tree3eb816e42a0cd857cf831c57baa59ad7cee478c7 /paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php
parent8242c982ebcdfc67274c8ab79a2f34aa451872d7 (diff)
downloadrafb-nopaste-48d7424647b146a66c5bde93ee836919933a4150.tar.gz
rafb-nopaste-48d7424647b146a66c5bde93ee836919933a4150.tar.xz
rafb-nopaste-48d7424647b146a66c5bde93ee836919933a4150.zip
added geshi syntax highlighter
Diffstat (limited to 'paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php')
-rw-r--r--paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php95
1 files changed, 95 insertions, 0 deletions
diff --git a/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php b/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php
new file mode 100644
index 0000000..9116c36
--- /dev/null
+++ b/paste/include/geshi/scripts/get-keywords/lib/functions.get-keywords.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * This file is part of GeSHi.
+ *
+ * GeSHi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GeSHi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GeSHi; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package scripts
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+/**
+ * Shows help text for get-keywords script and exits
+ *
+ * @since 0.1.0
+ */
+function show_help ()
+{
+ global $argv;
+ print <<<EOF
+Usage: php $argv[0] language keyword-group
+Language is a language supported by GeSHi and
+that also has a katepart language file or similar.
+
+Options:
+ -h --help Show this help text
+ -v --version Show version information
+ --list-groups [lang] List keyword groups for language [lang]
+ --list-langs List supported languages
+
+EOF;
+ exit;
+}
+
+/**
+ * Shows the version number of get-keywords and exits
+ *
+ * @since 0.1.0
+ */
+function show_version ()
+{
+ print GESHI_GET_KEYWORDS_VERSION .
+ "\n\$Date: 2005/07/25 07:03:11 $\n";
+ exit;
+}
+
+/**
+ * Checks whether the specified options were passed on the command
+ * line, and returns the value of the option if specified.
+ *
+ * @param string|array The options to check for
+ * @param array The arguments as parsed by Console_Getopt::getopt()
+ * @return True if the argument exists, the value of the argument if there is a value, else false
+ * @since 0.1.0
+ * @todo [blocking 1.1.5] Move this into console_getopt class
+ * @todo [blocking 1.1.5] Check about what is returned when option does exist
+ */
+function get_option ($options, $args)
+{
+ $options = (array) $options;
+ $args = $args[0];
+ foreach ($args as $arg) {
+ foreach ($options as $option) {
+ if ($option == $arg[0] || '--' . $option == $arg[0]) {
+ return ($arg[1]) ? $arg[1] : true;
+ }
+ }
+ }
+ return false;
+}
+
+?>