improvements to the help command, including outputting detailed descriptions
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "internal/launch.hpp"
|
||||
#include "commands.hpp"
|
||||
#include "dll.hpp"
|
||||
#include "help.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cellar::launch;
|
||||
@@ -14,6 +15,7 @@ DLL_PUBLIC map<string, CommandFunction> cellar::commands::launch_commands() {
|
||||
map<string, CommandFunction> result;
|
||||
/*[[[cog
|
||||
import cog
|
||||
import os
|
||||
|
||||
with open("src/launch/commands.txt") as commandfile:
|
||||
for line in commandfile:
|
||||
@@ -30,6 +32,17 @@ DLL_PUBLIC map<string, CommandFunction> cellar::commands::launch_commands() {
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\\", "\\\\")))
|
||||
# the replace methods escape " and \ characters
|
||||
else:
|
||||
print("-- No description is available for the {0} command.".format(name))
|
||||
|
||||
if os.path.exists("src/launch/help/" + name):
|
||||
cog.out("cellar::help::set_details(\"{0}\", R\"(".format(name))
|
||||
with open("src/launch/help/" + name) as detailsfile:
|
||||
for detail in detailsfile:
|
||||
cog.out(detail)
|
||||
cog.out(")\");")
|
||||
else:
|
||||
print("-- No details are available for the {0} command.".format(name))
|
||||
]]]*/
|
||||
//[[[end]]]
|
||||
return result;
|
||||
|
@@ -1,3 +1,3 @@
|
||||
launch launch_command
|
||||
winecfg launch_winecfg
|
||||
regedit launch_regedit
|
||||
launch launch_command Launch a program in WINE.
|
||||
winecfg launch_winecfg Launch winecfg.
|
||||
regedit launch_regedit Launch regedit.
|
||||
|
1
src/launch/help/regedit
Normal file
1
src/launch/help/regedit
Normal file
@@ -0,0 +1 @@
|
||||
This is an alias for "cellar launch regedit".
|
1
src/launch/help/winecfg
Normal file
1
src/launch/help/winecfg
Normal file
@@ -0,0 +1 @@
|
||||
This is an alias for "cellar launch winecfg".
|
Reference in New Issue
Block a user