From 26dc361eec69b00a1e0d91cc3e05e61e90e677cd Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Sat, 25 Mar 2017 09:31:29 -0700 Subject: [PATCH] fleshed out missing help system data --- src/bottles/commands.cpp.cog | 2 +- src/bottles/commands.txt | 8 ++++---- src/bottles/help/activate | 9 +++++++++ src/bottles/help/active | 3 +++ src/bottles/help/config | 5 +++++ src/bottles/help/list | 4 ++++ src/commands.cpp.cog | 2 +- src/commands.txt | 2 +- src/help/help | 3 +++ src/launch/commands.cpp.cog | 2 +- src/launch/help/launch | 8 ++++++++ 11 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 src/bottles/help/activate create mode 100644 src/bottles/help/active create mode 100644 src/bottles/help/config create mode 100644 src/bottles/help/list create mode 100644 src/help/help create mode 100644 src/launch/help/launch diff --git a/src/bottles/commands.cpp.cog b/src/bottles/commands.cpp.cog index cd4e605..2b5384a 100644 --- a/src/bottles/commands.cpp.cog +++ b/src/bottles/commands.cpp.cog @@ -39,7 +39,7 @@ DLL_PUBLIC map cellar::commands::bottles_commands() { cog.out("cellar::help::set_details(\"{0}\", R\"(".format(name)) with open("src/bottles/help/" + name) as detailsfile: for detail in detailsfile: - cog.out(detail) + cog.out(detail, dedent=True, trimblanklines=True) cog.out(")\");") else: print("-- No details are available for the {0} command.".format(name)) diff --git a/src/bottles/commands.txt b/src/bottles/commands.txt index 6e8ab3e..6a6b55f 100644 --- a/src/bottles/commands.txt +++ b/src/bottles/commands.txt @@ -1,4 +1,4 @@ -list print_bottles -active print_active_bottle -activate switch_active_bottle -config config_command +list print_bottles List all available WINE bottles. +active print_active_bottle Get the currently active WINE bottle. +activate switch_active_bottle Switch the active WINE bottle. +config config_command Change configuration options. diff --git a/src/bottles/help/activate b/src/bottles/help/activate new file mode 100644 index 0000000..cc9bc65 --- /dev/null +++ b/src/bottles/help/activate @@ -0,0 +1,9 @@ +cellar activate + +Marks a given WINE bottle as "active". can be one of the following: + - An absolute path, or a relative path (prefixed with "./") + - A simple string, which is assumed to be a suffix for a cellar-managed WINE + bottle. For instance, "cellar activate example" would set the active WINE + bottle to "~/.wine.example". + - As above, with the ".wine." prefix. cellar will accept this, but will throw + warnings about it. diff --git a/src/bottles/help/active b/src/bottles/help/active new file mode 100644 index 0000000..73db2d3 --- /dev/null +++ b/src/bottles/help/active @@ -0,0 +1,3 @@ +cellar active + +Prints the name of the active WINE bottle, as specified in cellar.json. diff --git a/src/bottles/help/config b/src/bottles/help/config new file mode 100644 index 0000000..975e801 --- /dev/null +++ b/src/bottles/help/config @@ -0,0 +1,5 @@ +cellar config get +cellar config set + +The first command prints the contents of from cellar.json in the active +WINE bottle. The second command sets in the same file to . diff --git a/src/bottles/help/list b/src/bottles/help/list new file mode 100644 index 0000000..2d4bf04 --- /dev/null +++ b/src/bottles/help/list @@ -0,0 +1,4 @@ +cellar list + +Prints a list of all cellar managable WINE bottles in your home directory, and +some basic information about them. diff --git a/src/commands.cpp.cog b/src/commands.cpp.cog index 05dd1f1..bc1dee8 100644 --- a/src/commands.cpp.cog +++ b/src/commands.cpp.cog @@ -49,7 +49,7 @@ map cellar::commands::core_commands() { cog.out("cellar::help::set_details(\"{0}\", R\"(".format(name)) with open("src/help/" + name) as detailsfile: for detail in detailsfile: - cog.out(detail) + cog.out(detail, dedent=True, trimblanklines=True) cog.out(")\");") else: print("-- No details are available for the {0} command.".format(name)) diff --git a/src/commands.txt b/src/commands.txt index f5ba7ad..d6bc972 100644 --- a/src/commands.txt +++ b/src/commands.txt @@ -1,2 +1,2 @@ version print_version Prints version information. -help help_command +help help_command Hello, there! diff --git a/src/help/help b/src/help/help new file mode 100644 index 0000000..c3a7c4f --- /dev/null +++ b/src/help/help @@ -0,0 +1,3 @@ +cellar help [] + +Prints a list of commands and their descriptions, or specify for details about a specific command. diff --git a/src/launch/commands.cpp.cog b/src/launch/commands.cpp.cog index 3cee31a..adba1a9 100644 --- a/src/launch/commands.cpp.cog +++ b/src/launch/commands.cpp.cog @@ -39,7 +39,7 @@ DLL_PUBLIC map cellar::commands::launch_commands() { 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(detail, dedent=True, trimblanklines=True) cog.out(")\");") else: print("-- No details are available for the {0} command.".format(name)) diff --git a/src/launch/help/launch b/src/launch/help/launch new file mode 100644 index 0000000..a22d657 --- /dev/null +++ b/src/launch/help/launch @@ -0,0 +1,8 @@ +cellar launch ... + +Launch WINE with the specified arguments (including, but not limited to, the +Windows program of your choice). + +"cellar launch" will automatically modify your system's environment variables +and WINE arguments as defined in the bottle's configuration file (cellar.json). +No changes are made by default.