gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] Gnucap Comprehensive Help System Implementation Detai


From: Felix Salfelder
Subject: Re: [Gnucap-devel] Gnucap Comprehensive Help System Implementation Details
Date: Sun, 25 May 2014 17:22:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, May 25, 2014 at 04:46:42PM +0200, Rishabh Yadav wrote:
> On Sun, May 25, 2014 at 4:14 PM, Felix Salfelder <address@hidden>wrote:
> What I am able to understand from your model is that you want to have a
> module embedded in each source file that contains the documentation and
> examples and then we need a plugin which gives a call to that module to
> present the help manual to the user.Correct me,if I am wrong.

not a module in each source file, but a procedure in each card.

the basic idea (very rough sketch, actually)

class CMD_HELP: public CARD {
  do_it(){
    string what;
    cmd >> what;
    const CARD* thing = find(what);
    out = <some stream>;
    out << "help on " << what << ":" << endl;
    what.help(out);
  }

  static string helptext;
  void help(stream out){
    out << helptext
  }
}c;

string CMD_HELP::helptext = "helptext on help";

DISPATCHER<CMD>::INSTALL d0(&command_dispatcher, "help", &c);

and then:
gnucap> help help
help on help:
helptext on help

cheers
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]