help descriptions now understood by the cog files, no implementation yet, don't try to build this
This commit is contained in:
		@@ -22,6 +22,14 @@ DLL_PUBLIC map<string, CommandFunction> cellar::commands::bottles_commands() {
 | 
			
		||||
                func = linesplit[1]
 | 
			
		||||
 | 
			
		||||
                cog.outl("result.insert(pair<string,CommandFunction>(\"{0}\", &{1}));".format(name, func))
 | 
			
		||||
 | 
			
		||||
                if (len(linesplit) > 2):
 | 
			
		||||
                    desc = " ".join(linesplit[2:]) # Rest of line assumed to be description
 | 
			
		||||
                    cog.outl("cellar::help::set_description(\"{0}\", \"{1}\");"
 | 
			
		||||
                             .format(name, desc
 | 
			
		||||
                             .replace("\"", "\\\"")
 | 
			
		||||
                             .replace("\\", "\\\\")))
 | 
			
		||||
                             # the replace methods escape " and \ characters
 | 
			
		||||
      ]]]*/
 | 
			
		||||
    //[[[end]]]
 | 
			
		||||
    return result;
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@
 | 
			
		||||
#include "commands.hpp"
 | 
			
		||||
#include "internal/core.hpp"
 | 
			
		||||
#include "cellar.hpp"
 | 
			
		||||
#include "help.hpp"
 | 
			
		||||
 | 
			
		||||
using namespace std;
 | 
			
		||||
using namespace cellar::commands;
 | 
			
		||||
@@ -32,6 +33,14 @@ map<string, CommandFunction> cellar::commands::core_commands() {
 | 
			
		||||
                func = linesplit[1]
 | 
			
		||||
 | 
			
		||||
                cog.outl("result.insert(pair<string,CommandFunction>(\"{0}\", &{1}));".format(name, func))
 | 
			
		||||
 | 
			
		||||
                if (len(linesplit) > 2):
 | 
			
		||||
                    desc = " ".join(linesplit[2:]) # Rest of line assumed to be description
 | 
			
		||||
                    cog.outl("cellar::help::set_description(\"{0}\", \"{1}\");"
 | 
			
		||||
                             .format(name, desc
 | 
			
		||||
                             .replace("\"", "\\\"")
 | 
			
		||||
                             .replace("\\", "\\\\")))
 | 
			
		||||
                             # the replace methods escape " and \ characters
 | 
			
		||||
      ]]]*/
 | 
			
		||||
    //[[[end]]]
 | 
			
		||||
    return result;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,2 +1,2 @@
 | 
			
		||||
version print_version
 | 
			
		||||
version print_version Prints version information.
 | 
			
		||||
help help_command
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@
 | 
			
		||||
 | 
			
		||||
#include "cellar.hpp"
 | 
			
		||||
#include "internal/core.hpp"
 | 
			
		||||
#include "help.cpp"
 | 
			
		||||
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,14 @@ DLL_PUBLIC map<string, CommandFunction> cellar::commands::launch_commands() {
 | 
			
		||||
                func = linesplit[1]
 | 
			
		||||
 | 
			
		||||
                cog.outl("result.insert(pair<string,CommandFunction>(\"{0}\", &{1}));".format(name, func))
 | 
			
		||||
 | 
			
		||||
                if (len(linesplit) > 2):
 | 
			
		||||
                    desc = " ".join(linesplit[2:]) # Rest of line assumed to be description
 | 
			
		||||
                    cog.outl("cellar::help::set_description(\"{0}\", \"{1}\");"
 | 
			
		||||
                             .format(name, desc
 | 
			
		||||
                             .replace("\"", "\\\"")
 | 
			
		||||
                             .replace("\\", "\\\\")))
 | 
			
		||||
                             # the replace methods escape " and \ characters
 | 
			
		||||
      ]]]*/
 | 
			
		||||
    //[[[end]]]
 | 
			
		||||
    return result;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user