return max($load_arr);
}
+
+// much better way of dealing with c-style args
+function argc() {
+ return get_app()->argc;
+}
+
+function argv($x) {
+ if(array_key_exists($x,get_app()->argv))
+ return get_app()->argv[$x];
+
+ return '';
+}
$text = '';
if ($a->argc > 1) {
- $text = load_doc_file('doc/' . $a->argv[1] . '.md');
- $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($a->argv[1]));
+ $path = '';
+ for($x = 1; $x < argc(); $x ++) {
+ if(strlen($path))
+ $path .= '/';
+ $path .= argv($x);
+ }
+ $title = basename($path);
+
+ $text = load_doc_file('doc/' . $path . '.md');
+ $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($title));
}
$home = load_doc_file('doc/Home.md');
if (!$text) {