From 08c8a523391de0986d92940ecd32e8dd85b33660 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 20 Sep 2010 16:13:23 -0400 Subject: help, minor update, revisit (includes minor fixes) --- lib/sisu/v2/help.rb | 261 +++++++++++++++++++++++++++------------------------- 1 file changed, 138 insertions(+), 123 deletions(-) diff --git a/lib/sisu/v2/help.rb b/lib/sisu/v2/help.rb index 2ddabdfd..b07ab6ed 100644 --- a/lib/sisu/v2/help.rb +++ b/lib/sisu/v2/help.rb @@ -75,9 +75,9 @@ module SiSU_Help def help_request begin gotten=nil - regx=/^(list|com(?:mands)?|mod(?:ifiers)|markup|syntax|example(?:37|38)?|head(?:ers?)?|(?:heading|title|level|structure)s?|endnotes|footnotes|tables?|customise|skin|dir(?:ectories)?|paths?|lang(?:uage)?|modules|setup|conf(?:ig(?:ure)?)?|standards?|li[cs]en[sc]e|scratch|install|termsheet|dublin(?:core)?|dc|customise|styles?|appearance|theme|env(ironment)?|dir(?:ector(?:y|ies))?|metaverse|abstract|features|summary|(?:short)?cuts?|sisu|about|ext(?:ernal)?(?:_?prog(?:rams)?)?)|utf-?8|plaintext|html|xml|xhtml|epub|odf|odt|opendocument|css|pdf|latex|tex|(?:tex)?info|search|(?:hyper)?est(?:raier)?|searchform|cgi|sql|db|postgresql|pg?sql|sqlite|convert|php|webrick|sitemaps?|ya?ml|ansi|colors|-[AabcDdEeFHhIMmNnopqrRSstUuVvwXxyZz0-9]|-[Ddcv]|-[CcFLSVvW]/ + regx=/^(list|com(?:mands)?|mod(?:ifiers)|markup|syntax|example(?:_v1|_v2)?|head(?:ers?)?|(?:heading|title|level|structure)s?|endnotes|footnotes|tables?|customise|skin|dir(?:ectories)?|paths?|lang(?:uage)?|modules|setup|conf(?:ig(?:ure)?)?|standards?|li[cs]en[sc]e|scratch|install|termsheet|dublin(?:core)?|dc|customise|styles?|appearance|theme|env(ironment)?|dir(?:ector(?:y|ies))?|metaverse|abstract|features|summary|(?:short)?cuts?|sisu|about|ext(?:ernal)?(?:_?prog(?:rams)?)?)|utf-?8|plaintext|html|xml|xhtml|epub|odf|odt|opendocument|css|pdf|latex|tex|(?:tex)?info|search|(?:hyper)?est(?:raier)?|searchform|cgi|sql|db|pg|postgresql|pg?sql|sqlite|convert|php|webrick|sitemaps?|ya?ml|ansi|colors|-[AabcDdEeFHhIMmNnopqrRSstUuVvwXxyZz0-9]|-[Ddcv]|-[CcFLSVvW]/ help_info=%{#{@cX.blue_hi}SiSU help#{@cX.off} #{@cX.ruby}~#{@cX.off} #{@request}} - help_list=%{#{@cX.blue}sisu --help#{@cX.off} #{@cX.cyan}type keyword else "enter" to exit help:\n\tkeywords include:#{@cX.off} #{@cX.brown}list, (com)mands, short(cuts), (mod)ifiers, (env)ironment, markup, syntax, headers, headings, endnotes, tables, example, customise, skin, (dir)ectories, path, (lang)uage, db, install, setup, (conf)igure, convert, external_programs, dublincore, termsheet, search, sql, hyper(est)raier, features, external_programs, license#{@cX.off} \n} + help_list=%{#{@cX.blue}sisu --help#{@cX.off} #{@cX.cyan}type keyword else "enter" to exit help:\n\tkeywords include:#{@cX.off} #{@cX.brown}list, (com)mands, short(cuts), (mod)ifiers, (env)ironment, markup, syntax, headers, headings, endnotes, tables, example, customise, skin, (dir)ectories, path, (lang)uage, db, install, setup, (conf)igure, convert, termsheet, search, sql, features, license#{@cX.off} \n} help_prompt=%{#{@cX.fuschia}exit, [or carriage return to exit help] #{@cX.off}\n#{@cX.blue_hi}SiSU help#{@cX.off} #{@cX.ruby}~#{@cX.off} } until gotten =~/exit|quit|bye|q|^\s*$/ \ and ( @request.nil? or @request.empty? ) @@ -91,60 +91,60 @@ module SiSU_Help when /h((?:elp)| )|~/i @help.summary help_@request - when /list/; @help.summary - when /com(mands)?/; @help.commands - when /mod(ifiers)?/; @help.modifiers - when /markup|syntax/; @help.markup - when /example\b/; @help.example - when /example37/; @help.example37 - when /example38/; @help.example38 - when /(?:heading|title|level)s?|structure/; @help.headings - when /head(ers?)?/; @help.headers - when /dublin(core)?|dc/; @help.dublin_core - when /(?:foot|end)notes/; @help.endnotes - when /tables?/; @help.tables - when /customise|skin/; @help.customise - when /modules/; @help.modules - when /env(ironment)?/; @help.environment - when /dir(ector(y|ies))?/; @help.directories - when /paths?/; @help.path - when /setup/; @help.setup - when /conf(?:ig(?:ure)?)?/; @help.configure - when /standards?/; @help.standards - when /lang(?:uage)?/; @help.languages - when /li[cs]en[sc]e/; @help.license - when /scratch/; @help.scratch - when /install/; @help.install - when /termsheet/; @help.termsheet - when /customise|styles?|appearance|theme/; @help.customise - when /metaverse/; @help.dal - when /plaintext|ascii|-[aAeE]/; @help.plaintext - when /utf-?8/i; @help.utf8 - when /html|-[hH]/; @help.html - when /css/; @help.css - when /xhtml|-b/; @help.xhtml - when /xml|-[xX]/; @help.xml - when /odf|odt|opendocument|-o/; @help.odf - when /epub|-e/; @help.epub - when /php/; @help.php - when /pdf|-p/; @help.pdf - when /latex|tex/; @help.latex - when /(tex)?info/; @help.texinfo - when /lout/; @help.lout - when /concordance|index|-w/; @help.concordance - when /search\b/; @help.help_search - when /(?:hyper)?est(?:raier)?/; @help.hyperestraier - when /db|database|sql|postgresql|sqlite|pg?sql|-[dD]/; @help.sql - when /searchform|cgi/; @help.cgi - when /convert/; @help.convert - when /webrick|-W/; @help.webrick - when /abstract|features|summary|about|sisu/; @help.abstract - when /ext(?:ernal)?(?:_?prog(?:rams)?)?/; @help.external_programs - when /ya?ml/; @help.yaml - when /sitemaps?/; @help.sitemap - when /(?:short)?cuts?/; @help.shortcuts - when /ansi|colors?/; SiSU_Screen::Ansi.new('c').colors - else @help.summary + when /list/; @help.summary + when /com(mands)?/; @help.commands + when /mod(ifiers)?/; @help.modifiers + when /markup|syntax/; @help.markup + when /example\b/; @help.example_v2 + when /example_v1/; @help.example_v1 + when /example(_v2)?/; @help.example_v2 + when /(?:heading|title|level)s?|structure/; @help.headings + when /head(ers?)?/; @help.headers + when /dublin(core)?|dc/; @help.dublin_core + when /(?:foot|end)notes/; @help.endnotes + when /tables?/; @help.tables + when /customise|skin/; @help.customise + when /modules/; @help.modules + when /env(ironment)?/; @help.environment + when /dir(ector(y|ies))?/; @help.directories + when /paths?/; @help.path + when /setup/; @help.setup + when /conf(?:ig(?:ure)?)?/; @help.configure + when /standards?/; @help.standards + when /lang(?:uage)?/; @help.languages + when /li[cs]en[sc]e/; @help.license + when /scratch/; @help.scratch + when /install/; @help.install + when /(?:--)?termsheet/; @help.termsheet + when /customise|styles?|appearance|theme/; @help.customise + when /metaverse/; @help.dal + when /(?:--)?plaintext|(?:--)?te?xt|-[aAeE]/; @help.plaintext + when /utf-?8/i; @help.utf8 + when /(?:--)?html|-[hH]/; @help.html + when /css/; @help.css + when /(?:--)?xhtml|-b/; @help.xhtml + when /(?:--)?xml|-[xX]/; @help.xml + when /(?:--)?odf|(?:--)?odt|opendocument|-o/; @help.odf + when /(?:--)?epub|-e/; @help.epub + when /php/; @help.php + when /(?:--)?pdf|-p/; @help.pdf + when /latex|tex/; @help.latex + when /(tex)?info/; @help.texinfo + when /lout/; @help.lout + when /concordance|index|-w/; @help.concordance + when /search\b/; @help.help_search + when /(?:hyper)?est(?:raier)?/; @help.hyperestraier + when /db|database|sql|postgresql|(?:--)?sqlite|(?:--)?pg|pg?sql|-[dD]/; @help.sql + when /searchform|cgi/; @help.cgi + when /convert/; @help.convert + when /(?:--)?webrick|-W/; @help.webrick + when /abstract|features|summary|about|sisu/; @help.abstract + when /ext(?:ernal)?(?:_?prog(?:rams)?)?/; @help.external_programs + when /ya?ml/; @help.yaml + when /sitemaps?/; @help.sitemap + when /(?:short)?cuts?/; @help.shortcuts + when /ansi|colors?/; SiSU_Screen::Ansi.new('c').colors + else @help.summary end print help_list print help_prompt @@ -159,7 +159,7 @@ module SiSU_Help end def summary print <