aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-23 11:15:51 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-23 11:15:51 +0100
commit9a3640388f5cd19b03dc05bd534da15c6d96d5fc (patch)
treef49025abb6ac0512125ddd2a96ed07ef8e1122e2
parent7eab297e804d73548ac4c2cb6ad9145d095cdb34 (diff)
downloadpaludis-9a3640388f5cd19b03dc05bd534da15c6d96d5fc.tar.gz
paludis-9a3640388f5cd19b03dc05bd534da15c6d96d5fc.tar.xz
cave print-formats -> cave dump-cave-formats-conf
-rw-r--r--.gitignore2
-rw-r--r--doc/clients/Makefile.am2
-rw-r--r--src/clients/cave/Makefile.am4
-rw-r--r--src/clients/cave/cmd_dump_cave_formats_conf.cc (renamed from src/clients/cave/cmd_print_formats.cc)27
-rw-r--r--src/clients/cave/cmd_dump_cave_formats_conf.hh (renamed from src/clients/cave/cmd_print_formats.hh)6
-rw-r--r--src/clients/cave/command_factory.cc4
6 files changed, 23 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
index 2541175..2beb533 100644
--- a/.gitignore
+++ b/.gitignore
@@ -84,6 +84,7 @@ paludis-*.*.*.tar.bz2
/doc/clients/cave-config.html
/doc/clients/cave-contents.html
/doc/clients/cave-display-resolution.html
+/doc/clients/cave-dump-cave-formats-conf.html
/doc/clients/cave-executables.html
/doc/clients/cave-execute-resolution.html
/doc/clients/cave-find-candidates.html
@@ -99,7 +100,6 @@ paludis-*.*.*.tar.bz2
/doc/clients/cave-print-categories.html
/doc/clients/cave-print-commands.html
/doc/clients/cave-print-environment-metadata.html
-/doc/clients/cave-print-formats.html
/doc/clients/cave-print-id-actions.html
/doc/clients/cave-print-id-contents.html
/doc/clients/cave-print-id-environment-variable.html
diff --git a/doc/clients/Makefile.am b/doc/clients/Makefile.am
index 0527590..05eac7c 100644
--- a/doc/clients/Makefile.am
+++ b/doc/clients/Makefile.am
@@ -29,6 +29,7 @@ CAVE_COMMANDS_HTML = \
cave-config.html \
cave-contents.html \
cave-display-resolution.html \
+ cave-dump-cave-formats-conf.html \
cave-executables.html \
cave-execute-resolution.html \
cave-find-candidates.html \
@@ -44,7 +45,6 @@ CAVE_COMMANDS_HTML = \
cave-print-categories.html \
cave-print-commands.html \
cave-print-environment-metadata.html \
- cave-print-formats.html \
cave-print-id-actions.html \
cave-print-id-contents.html \
cave-print-id-environment-variable.html \
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index be13c65..53e129a 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -22,6 +22,7 @@ command_MANS = \
cave-config.1 \
cave-contents.1 \
cave-display-resolution.1 \
+ cave-dump-cave-formats-conf.1 \
cave-executables.1 \
cave-execute-resolution.1 \
cave-find-candidates.1 \
@@ -37,7 +38,6 @@ command_MANS = \
cave-print-categories.1 \
cave-print-commands.1 \
cave-print-environment-metadata.1 \
- cave-print-formats.1 \
cave-print-id-actions.1 \
cave-print-id-contents.1 \
cave-print-id-environment-variable.1 \
@@ -114,6 +114,7 @@ libcave_a_SOURCES = \
cmd_contents.cc cmd_contents.hh cmd_contents-fmt.hh \
cmd_config.cc cmd_config.hh \
cmd_display_resolution.cc cmd_display_resolution.hh cmd_display_resolution-fmt.hh \
+ cmd_dump_cave_formats_conf.cc cmd_dump_cave_formats_conf.hh \
cmd_executables.cc cmd_executables.hh cmd_executables-fmt.hh \
cmd_execute_resolution.cc cmd_execute_resolution.hh cmd_execute_resolution-fmt.hh \
cmd_find_candidates.cc cmd_find_candidates.hh \
@@ -129,7 +130,6 @@ libcave_a_SOURCES = \
cmd_print_categories.cc cmd_print_categories.hh \
cmd_print_commands.cc cmd_print_commands.hh \
cmd_print_environment_metadata.cc cmd_print_environment_metadata.hh \
- cmd_print_formats.cc cmd_print_formats.hh \
cmd_print_id_actions.cc cmd_print_id_actions.hh \
cmd_print_id_contents.cc cmd_print_id_contents.hh \
cmd_print_id_environment_variable.cc cmd_print_id_environment_variable.hh \
diff --git a/src/clients/cave/cmd_print_formats.cc b/src/clients/cave/cmd_dump_cave_formats_conf.cc
index fe4c50b..864c7ff 100644
--- a/src/clients/cave/cmd_print_formats.cc
+++ b/src/clients/cave/cmd_dump_cave_formats_conf.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "cmd_print_formats.hh"
+#include "cmd_dump_cave_formats_conf.hh"
#include <paludis/util/stringify.hh>
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
@@ -152,26 +152,27 @@ namespace
namespace
{
- struct PrintFormatsCommandLine :
+ struct DumpCaveFormatsConfCommandLine :
CaveCommandCommandLine
{
virtual std::string app_name() const
{
- return "cave print-formats";
+ return "cave dump-cave-formats-conf";
}
virtual std::string app_synopsis() const
{
- return "Prints a list of known format strings.";
+ return "Output a ~/.cave/formats.conf";
}
virtual std::string app_description() const
{
- return "Prints a list of known format strings. No formatting is used, making the output "
- "suitable for parsing by scripts.";
+ return "Outputs suitable contents for ~/.cave/formats.conf. This file can be used to "
+ "customise the output format for many cave commands (although not commands designed "
+ "for script use, such as print-*).";
}
- PrintFormatsCommandLine()
+ DumpCaveFormatsConfCommandLine()
{
add_usage_line("");
}
@@ -179,13 +180,13 @@ namespace
}
int
-PrintFormatsCommand::run(
+DumpCaveFormatsConfCommand::run(
const std::shared_ptr<Environment> &,
const std::shared_ptr<const Sequence<std::string > > & args
)
{
- PrintFormatsCommandLine cmdline;
- cmdline.run(args, "CAVE", "CAVE_PRINT_FORMATS_OPTIONS", "CAVE_PRINT_FORMATS_CMDLINE");
+ DumpCaveFormatsConfCommandLine cmdline;
+ cmdline.run(args, "CAVE", "CAVE_DUMP_CAVE_FORMATS_CONF_OPTIONS", "CAVE_DUMP_CAVE_FORMATS_CONF_CMDLINE");
if (cmdline.a_help.specified())
{
@@ -194,7 +195,7 @@ PrintFormatsCommand::run(
}
if (cmdline.begin_parameters() != cmdline.end_parameters())
- throw args::DoHelp("print-formats takes no parameters");
+ throw args::DoHelp("dump-cave-formats-conf takes no parameters");
cout << "[colours]" << endl;
cout << "red" << " = " << "\\e[0;31m" << endl;
@@ -238,8 +239,8 @@ PrintFormatsCommand::run(
}
std::shared_ptr<args::ArgsHandler>
-PrintFormatsCommand::make_doc_cmdline()
+DumpCaveFormatsConfCommand::make_doc_cmdline()
{
- return std::make_shared<PrintFormatsCommandLine>();
+ return std::make_shared<DumpCaveFormatsConfCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_formats.hh b/src/clients/cave/cmd_dump_cave_formats_conf.hh
index 161947c..d0546e1 100644
--- a/src/clients/cave/cmd_print_formats.hh
+++ b/src/clients/cave/cmd_dump_cave_formats_conf.hh
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_SRC_CLIENTS_CAVE_CMD_PRINT_FORMATS_HH
-#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_CMD_PRINT_FORMATS_HH 1
+#ifndef PALUDIS_GUARD_SRC_CLIENTS_CAVE_CMD_DUMP_CAVE_FORMATS_CONF_HH
+#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_CMD_DUMP_CAVE_FORMATS_CONF_HH 1
#include "command.hh"
@@ -26,7 +26,7 @@ namespace paludis
{
namespace cave
{
- class PALUDIS_VISIBLE PrintFormatsCommand :
+ class PALUDIS_VISIBLE DumpCaveFormatsConfCommand :
public Command
{
public:
diff --git a/src/clients/cave/command_factory.cc b/src/clients/cave/command_factory.cc
index 4761186..bf9c4d5 100644
--- a/src/clients/cave/command_factory.cc
+++ b/src/clients/cave/command_factory.cc
@@ -36,6 +36,7 @@
#include "cmd_config.hh"
#include "cmd_contents.hh"
#include "cmd_display_resolution.hh"
+#include "cmd_dump_cave_formats_conf.hh"
#include "cmd_executables.hh"
#include "cmd_execute_resolution.hh"
#include "cmd_find_candidates.hh"
@@ -51,7 +52,6 @@
#include "cmd_print_categories.hh"
#include "cmd_print_commands.hh"
#include "cmd_print_environment_metadata.hh"
-#include "cmd_print_formats.hh"
#include "cmd_print_id_actions.hh"
#include "cmd_print_id_contents.hh"
#include "cmd_print_id_environment_variable.hh"
@@ -144,6 +144,7 @@ CommandFactory::CommandFactory() :
_imp->handlers.insert(std::make_pair("config", std::bind(&make_command<ConfigCommand>)));
_imp->handlers.insert(std::make_pair("contents", std::bind(&make_command<ContentsCommand>)));
_imp->handlers.insert(std::make_pair("display-resolution", std::bind(&make_command<DisplayResolutionCommand>)));
+ _imp->handlers.insert(std::make_pair("dump-cave-formats-conf", std::bind(&make_command<DumpCaveFormatsConfCommand>)));
_imp->handlers.insert(std::make_pair("executables", std::bind(&make_command<ExecutablesCommand>)));
_imp->handlers.insert(std::make_pair("execute-resolution", std::bind(&make_command<ExecuteResolutionCommand>)));
_imp->handlers.insert(std::make_pair("find-candidates", std::bind(&make_command<FindCandidatesCommand>)));
@@ -160,7 +161,6 @@ CommandFactory::CommandFactory() :
_imp->handlers.insert(std::make_pair("print-categories", std::bind(&make_command<PrintCategoriesCommand>)));
_imp->handlers.insert(std::make_pair("print-commands", std::bind(&make_command<PrintCommandsCommand>)));
_imp->handlers.insert(std::make_pair("print-environment-metadata", std::bind(&make_command<PrintEnvironmentMetadataCommand>)));
- _imp->handlers.insert(std::make_pair("print-formats", std::bind(&make_command<PrintFormatsCommand>)));
_imp->handlers.insert(std::make_pair("print-id-actions", std::bind(&make_command<PrintIDActionsCommand>)));
_imp->handlers.insert(std::make_pair("print-id-contents", std::bind(&make_command<PrintIDContentsCommand>)));
_imp->handlers.insert(std::make_pair("print-id-environment-variable", std::bind(&make_command<PrintIDEnvironmentVariableCommand>)));