diff options
author | 2011-03-12 21:41:50 +0000 | |
---|---|---|
committer | 2011-03-12 22:24:33 +0000 | |
commit | 67bd5a2be68eb8dc7faeab3de48dbf970812331d (patch) | |
tree | e8af9459c6e736a5c682048924ae21e523486487 | |
parent | 2cf131574c5dd27d2cd1a6a8a3c330bb65cd9bae (diff) | |
download | paludis-67bd5a2be68eb8dc7faeab3de48dbf970812331d.tar.gz paludis-67bd5a2be68eb8dc7faeab3de48dbf970812331d.tar.xz |
Make command importance an enum
117 files changed, 523 insertions, 173 deletions
diff --git a/src/clients/cave/cmd_config.cc b/src/clients/cave/cmd_config.cc index 336e77805..057d82331 100644 --- a/src/clients/cave/cmd_config.cc +++ b/src/clients/cave/cmd_config.cc @@ -119,3 +119,9 @@ ConfigCommand::make_doc_cmdline() return std::make_shared<ConfigCommandLine>(); } +CommandImportance +ConfigCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_config.hh b/src/clients/cave/cmd_config.hh index 33495876c..9cf362a90 100644 --- a/src/clients/cave/cmd_config.hh +++ b/src/clients/cave/cmd_config.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc index 8f1d9372d..60fe2f541 100644 --- a/src/clients/cave/cmd_contents.cc +++ b/src/clients/cave/cmd_contents.cc @@ -156,3 +156,9 @@ ContentsCommand::make_doc_cmdline() return std::make_shared<ContentsCommandLine>(); } +CommandImportance +ContentsCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_contents.hh b/src/clients/cave/cmd_contents.hh index 58c46dccf..1dddb9f5f 100644 --- a/src/clients/cave/cmd_contents.hh +++ b/src/clients/cave/cmd_contents.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008, 2010 Ciaran McCreesh + * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_digest.cc b/src/clients/cave/cmd_digest.cc index bfa0ac910..430bc518e 100644 --- a/src/clients/cave/cmd_digest.cc +++ b/src/clients/cave/cmd_digest.cc @@ -174,3 +174,9 @@ DigestCommand::make_doc_cmdline() return std::make_shared<DigestCommandLine>(); } +CommandImportance +DigestCommand::importance() const +{ + return ci_development; +} + diff --git a/src/clients/cave/cmd_digest.hh b/src/clients/cave/cmd_digest.hh index 75d16e58d..bf50cc3d5 100644 --- a/src/clients/cave/cmd_digest.hh +++ b/src/clients/cave/cmd_digest.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc index e41400adb..f36544bc0 100755 --- a/src/clients/cave/cmd_display_resolution.cc +++ b/src/clients/cave/cmd_display_resolution.cc @@ -1845,12 +1845,6 @@ namespace } } -bool -DisplayResolutionCommand::important() const -{ - return false; -} - int DisplayResolutionCommand::run( const std::shared_ptr<Environment> & env, @@ -1913,3 +1907,9 @@ DisplayResolutionCommand::make_doc_cmdline() return std::make_shared<DisplayResolutionCommandLine>(); } +CommandImportance +DisplayResolutionCommand::importance() const +{ + return ci_internal; +} + diff --git a/src/clients/cave/cmd_display_resolution.hh b/src/clients/cave/cmd_display_resolution.hh index fcf1d7093..c22ff8e42 100644 --- a/src/clients/cave/cmd_display_resolution.hh +++ b/src/clients/cave/cmd_display_resolution.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -31,7 +31,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_dump_cave_formats_conf.cc b/src/clients/cave/cmd_dump_cave_formats_conf.cc index e1cc518f2..5453380c1 100644 --- a/src/clients/cave/cmd_dump_cave_formats_conf.cc +++ b/src/clients/cave/cmd_dump_cave_formats_conf.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -246,3 +246,9 @@ DumpCaveFormatsConfCommand::make_doc_cmdline() return std::make_shared<DumpCaveFormatsConfCommandLine>(); } +CommandImportance +DumpCaveFormatsConfCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_dump_cave_formats_conf.hh b/src/clients/cave/cmd_dump_cave_formats_conf.hh index d0546e199..77fa4a3d6 100644 --- a/src/clients/cave/cmd_dump_cave_formats_conf.hh +++ b/src/clients/cave/cmd_dump_cave_formats_conf.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_executables.cc b/src/clients/cave/cmd_executables.cc index b7e5c3ab2..4130225a6 100644 --- a/src/clients/cave/cmd_executables.cc +++ b/src/clients/cave/cmd_executables.cc @@ -2,7 +2,7 @@ /* * Copyright (c) 2009 Alexander Færøy - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -102,3 +102,9 @@ ExecutablesCommand::make_doc_cmdline() return std::make_shared<ExecutablesCommandLine>(); } +CommandImportance +ExecutablesCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_executables.hh b/src/clients/cave/cmd_executables.hh index a84029478..097190347 100644 --- a/src/clients/cave/cmd_executables.hh +++ b/src/clients/cave/cmd_executables.hh @@ -2,7 +2,7 @@ /* * Copyright (c) 2009 Alexander Færøy - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -31,6 +31,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc index ebc2a68a3..4e14b80bc 100644 --- a/src/clients/cave/cmd_execute_resolution.cc +++ b/src/clients/cave/cmd_execute_resolution.cc @@ -1779,12 +1779,6 @@ namespace } } -bool -ExecuteResolutionCommand::important() const -{ - return false; -} - int ExecuteResolutionCommand::run( const std::shared_ptr<Environment> & env, @@ -1842,3 +1836,9 @@ ExecuteResolutionCommand::make_doc_cmdline() return std::make_shared<ExecuteResolutionCommandLine>(); } +CommandImportance +ExecuteResolutionCommand::importance() const +{ + return ci_internal; +} + diff --git a/src/clients/cave/cmd_execute_resolution.hh b/src/clients/cave/cmd_execute_resolution.hh index 5e76354ee..63c669dbc 100644 --- a/src/clients/cave/cmd_execute_resolution.hh +++ b/src/clients/cave/cmd_execute_resolution.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -31,7 +31,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc index e48668a6d..ee55cbd36 100644 --- a/src/clients/cave/cmd_find_candidates.cc +++ b/src/clients/cave/cmd_find_candidates.cc @@ -342,3 +342,9 @@ FindCandidatesCommand::make_doc_cmdline() return std::make_shared<FindCandidatesCommandLine>(); } +CommandImportance +FindCandidatesCommand::importance() const +{ + return ci_internal; +} + diff --git a/src/clients/cave/cmd_find_candidates.hh b/src/clients/cave/cmd_find_candidates.hh index 382c6be23..716d3f1d4 100644 --- a/src/clients/cave/cmd_find_candidates.hh +++ b/src/clients/cave/cmd_find_candidates.hh @@ -34,6 +34,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_fix_cache.cc b/src/clients/cave/cmd_fix_cache.cc index da1edefac..f536c9075 100644 --- a/src/clients/cave/cmd_fix_cache.cc +++ b/src/clients/cave/cmd_fix_cache.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -155,3 +155,9 @@ FixCacheCommand::make_doc_cmdline() { return std::make_shared<FixCacheCommandLine>(); } +CommandImportance +FixCacheCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_fix_cache.hh b/src/clients/cave/cmd_fix_cache.hh index 9c4e33a37..01b0f00ae 100644 --- a/src/clients/cave/cmd_fix_cache.hh +++ b/src/clients/cave/cmd_fix_cache.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc index 95c753536..1c9047223 100644 --- a/src/clients/cave/cmd_fix_linkage.cc +++ b/src/clients/cave/cmd_fix_linkage.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -49,12 +49,6 @@ using namespace cave; using std::cout; using std::endl; -bool -FixLinkageCommand::important() const -{ - return true; -} - namespace { struct FixLinkageCommandLine : @@ -260,3 +254,9 @@ FixLinkageCommand::make_doc_cmdline() return std::make_shared<FixLinkageCommandLine>(); } +CommandImportance +FixLinkageCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_fix_linkage.hh b/src/clients/cave/cmd_fix_linkage.hh index 6dd3d9191..35fbbe3e7 100644 --- a/src/clients/cave/cmd_fix_linkage.hh +++ b/src/clients/cave/cmd_fix_linkage.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_generate_metadata.cc b/src/clients/cave/cmd_generate_metadata.cc index 5e64242eb..fee73df62 100644 --- a/src/clients/cave/cmd_generate_metadata.cc +++ b/src/clients/cave/cmd_generate_metadata.cc @@ -323,3 +323,9 @@ GenerateMetadataCommand::make_doc_cmdline() return std::make_shared<GenerateMetadataCommandLine>(); } +CommandImportance +GenerateMetadataCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_generate_metadata.hh b/src/clients/cave/cmd_generate_metadata.hh index fa68f67c3..ac86ce19b 100644 --- a/src/clients/cave/cmd_generate_metadata.hh +++ b/src/clients/cave/cmd_generate_metadata.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_graph_jobs.cc b/src/clients/cave/cmd_graph_jobs.cc index 39ad3daac..5583422b7 100644 --- a/src/clients/cave/cmd_graph_jobs.cc +++ b/src/clients/cave/cmd_graph_jobs.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -208,12 +208,6 @@ namespace } } -bool -GraphJobsCommand::important() const -{ - return false; -} - int GraphJobsCommand::run( const std::shared_ptr<Environment> & env, @@ -276,3 +270,9 @@ GraphJobsCommand::make_doc_cmdline() return std::make_shared<GraphJobsCommandLine>(); } +CommandImportance +GraphJobsCommand::importance() const +{ + return ci_internal; +} + diff --git a/src/clients/cave/cmd_graph_jobs.hh b/src/clients/cave/cmd_graph_jobs.hh index c1772d556..d0786a777 100644 --- a/src/clients/cave/cmd_graph_jobs.hh +++ b/src/clients/cave/cmd_graph_jobs.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -31,7 +31,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_has_version.cc b/src/clients/cave/cmd_has_version.cc index af906895e..18cb85672 100644 --- a/src/clients/cave/cmd_has_version.cc +++ b/src/clients/cave/cmd_has_version.cc @@ -112,3 +112,9 @@ HasVersionCommand::make_doc_cmdline() return std::make_shared<HasVersionCommandLine>(); } +CommandImportance +HasVersionCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_has_version.hh b/src/clients/cave/cmd_has_version.hh index 59be998df..a30690255 100644 --- a/src/clients/cave/cmd_has_version.hh +++ b/src/clients/cave/cmd_has_version.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_help.cc b/src/clients/cave/cmd_help.cc index baab367c5..bf23f9dda 100644 --- a/src/clients/cave/cmd_help.cc +++ b/src/clients/cave/cmd_help.cc @@ -74,11 +74,11 @@ namespace std::shared_ptr<Command> lhs(CommandFactory::get_instance()->create(left)); std::shared_ptr<Command> rhs(CommandFactory::get_instance()->create(right)); - if (lhs->important() && rhs->important()) + if (lhs->importance() == ci_core && rhs->importance() == ci_core) return left.length() < right.length(); - else if (lhs->important() && ! rhs->important()) + else if (lhs->importance() == ci_core && ! rhs->importance() == ci_core) return false; - else if (! lhs->important() && rhs->important()) + else if (! lhs->importance() == ci_core && rhs->importance() == ci_core) return true; else return false; @@ -86,12 +86,6 @@ namespace }; } -bool -HelpCommand::important() const -{ - return true; -} - int HelpCommand::run(const std::shared_ptr<Environment> & env, const std::shared_ptr< const Sequence<std::string> > & args) @@ -138,7 +132,7 @@ HelpCommand::run(const std::shared_ptr<Environment> & env, { std::shared_ptr<Command> instance(CommandFactory::get_instance()->create(*cmd)); - if (instance->important()) + if (instance->importance() == ci_core) cout << " " << *cmd << std::string(length - cmd->length(), ' ') << " " << instance->make_doc_cmdline()->app_synopsis() << std::endl; } @@ -162,3 +156,9 @@ HelpCommand::make_doc_cmdline() return std::make_shared<HelpCommandLine>(); } +CommandImportance +HelpCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_help.hh b/src/clients/cave/cmd_help.hh index 2245a9453..a903b6ea5 100644 --- a/src/clients/cave/cmd_help.hh +++ b/src/clients/cave/cmd_help.hh @@ -29,7 +29,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run(const std::shared_ptr<Environment> &, const std::shared_ptr< const Sequence<std::string> > & args); diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc index a34a23dda..48a3d789b 100644 --- a/src/clients/cave/cmd_import.cc +++ b/src/clients/cave/cmd_import.cc @@ -324,3 +324,9 @@ ImportCommand::make_doc_cmdline() return std::make_shared<ImportCommandLine>(); } +CommandImportance +ImportCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_import.hh b/src/clients/cave/cmd_import.hh index f4629ae51..72c7f4d51 100644 --- a/src/clients/cave/cmd_import.hh +++ b/src/clients/cave/cmd_import.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 2009, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc index bd72650d7..a0b8d1330 100644 --- a/src/clients/cave/cmd_info.cc +++ b/src/clients/cave/cmd_info.cc @@ -390,12 +390,6 @@ namespace } } -bool -InfoCommand::important() const -{ - return true; -} - int InfoCommand::run( const std::shared_ptr<Environment> & env, @@ -445,3 +439,9 @@ InfoCommand::make_doc_cmdline() return std::make_shared<InfoCommandLine>(); } +CommandImportance +InfoCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_info.hh b/src/clients/cave/cmd_info.hh index ce6c6f7cf..ad6e113e9 100644 --- a/src/clients/cave/cmd_info.hh +++ b/src/clients/cave/cmd_info.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_manage_search_index.cc b/src/clients/cave/cmd_manage_search_index.cc index e95aea22d..52b76a740 100644 --- a/src/clients/cave/cmd_manage_search_index.cc +++ b/src/clients/cave/cmd_manage_search_index.cc @@ -309,3 +309,9 @@ ManageSearchIndexCommand::make_doc_cmdline() return std::make_shared<ManageSearchIndexCommandLine>(); } +CommandImportance +ManageSearchIndexCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_manage_search_index.hh b/src/clients/cave/cmd_manage_search_index.hh index 4c216dafd..5bfa632a6 100644 --- a/src/clients/cave/cmd_manage_search_index.hh +++ b/src/clients/cave/cmd_manage_search_index.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc index d2c22fb75..c41a31cd8 100644 --- a/src/clients/cave/cmd_match.cc +++ b/src/clients/cave/cmd_match.cc @@ -461,3 +461,9 @@ MatchCommand::make_doc_cmdline() return std::make_shared<MatchCommandLine>(); } +CommandImportance +MatchCommand::importance() const +{ + return ci_internal; +} + diff --git a/src/clients/cave/cmd_match.hh b/src/clients/cave/cmd_match.hh index f4d002a70..4d72bb198 100644 --- a/src/clients/cave/cmd_match.hh +++ b/src/clients/cave/cmd_match.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -34,6 +34,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_mirror.cc b/src/clients/cave/cmd_mirror.cc index c945aa169..0dcd36f6f 100644 --- a/src/clients/cave/cmd_mirror.cc +++ b/src/clients/cave/cmd_mirror.cc @@ -172,3 +172,9 @@ MirrorCommand::make_doc_cmdline() return std::make_shared<MirrorCommandLine>(); } +CommandImportance +MirrorCommand::importance() const +{ + return ci_development; +} + diff --git a/src/clients/cave/cmd_mirror.hh b/src/clients/cave/cmd_mirror.hh index b31df2280..6b56e5b7d 100644 --- a/src/clients/cave/cmd_mirror.hh +++ b/src/clients/cave/cmd_mirror.hh @@ -31,6 +31,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_owner.cc b/src/clients/cave/cmd_owner.cc index bdba23e1e..c6b5239b3 100644 --- a/src/clients/cave/cmd_owner.cc +++ b/src/clients/cave/cmd_owner.cc @@ -116,3 +116,9 @@ OwnerCommand::make_doc_cmdline() return std::make_shared<OwnerCommandLine>(); } +CommandImportance +OwnerCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_owner.hh b/src/clients/cave/cmd_owner.hh index 6d55636ab..ed300f2ed 100644 --- a/src/clients/cave/cmd_owner.hh +++ b/src/clients/cave/cmd_owner.hh @@ -2,7 +2,7 @@ /* * Copyright (c) 2008 Alexander Færøy - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -31,6 +31,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc index fce13cb56..ca6d2c768 100644 --- a/src/clients/cave/cmd_perform.cc +++ b/src/clients/cave/cmd_perform.cc @@ -610,3 +610,9 @@ PerformCommand::make_doc_cmdline() return std::make_shared<PerformCommandLine>(); } +CommandImportance +PerformCommand::importance() const +{ + return ci_internal; +} + diff --git a/src/clients/cave/cmd_perform.hh b/src/clients/cave/cmd_perform.hh index db8a84a35..111cb2fe3 100644 --- a/src/clients/cave/cmd_perform.hh +++ b/src/clients/cave/cmd_perform.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 2009, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_best_version.cc b/src/clients/cave/cmd_print_best_version.cc index 26ee18f45..6691611be 100644 --- a/src/clients/cave/cmd_print_best_version.cc +++ b/src/clients/cave/cmd_print_best_version.cc @@ -141,3 +141,9 @@ PrintBestVersionCommand::make_doc_cmdline() return std::make_shared<PrintBestVersionCommandLine>(); } +CommandImportance +PrintBestVersionCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_best_version.hh b/src/clients/cave/cmd_print_best_version.hh index 913a0f5e4..e33de22b6 100644 --- a/src/clients/cave/cmd_print_best_version.hh +++ b/src/clients/cave/cmd_print_best_version.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_categories.cc b/src/clients/cave/cmd_print_categories.cc index e58339973..112d3721e 100644 --- a/src/clients/cave/cmd_print_categories.cc +++ b/src/clients/cave/cmd_print_categories.cc @@ -131,3 +131,9 @@ PrintCategoriesCommand::make_doc_cmdline() return std::make_shared<PrintCategoriesCommandLine>(); } +CommandImportance +PrintCategoriesCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_categories.hh b/src/clients/cave/cmd_print_categories.hh index e30820b7a..cb31dc410 100644 --- a/src/clients/cave/cmd_print_categories.hh +++ b/src/clients/cave/cmd_print_categories.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_commands.cc b/src/clients/cave/cmd_print_commands.cc index 6fcf8ae31..98de969ac 100644 --- a/src/clients/cave/cmd_print_commands.cc +++ b/src/clients/cave/cmd_print_commands.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008, 2010 Ciaran McCreesh + * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -90,7 +90,7 @@ PrintCommandsCommand::run( { std::shared_ptr<Command> instance(CommandFactory::get_instance()->create(*cmd)); - if (! cmdline.a_all.specified() && ! instance->important()) + if (! cmdline.a_all.specified() && ! instance->importance() == ci_core) continue; cout << stringify(*cmd) << endl; @@ -105,3 +105,9 @@ PrintCommandsCommand::make_doc_cmdline() return std::make_shared<PrintCommandsCommandLine>(); } +CommandImportance +PrintCommandsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_commands.hh b/src/clients/cave/cmd_print_commands.hh index 3ad580a4d..f6049a0d3 100644 --- a/src/clients/cave/cmd_print_commands.hh +++ b/src/clients/cave/cmd_print_commands.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_dependent_ids.cc b/src/clients/cave/cmd_print_dependent_ids.cc index f72597913..b02c983ab 100644 --- a/src/clients/cave/cmd_print_dependent_ids.cc +++ b/src/clients/cave/cmd_print_dependent_ids.cc @@ -157,3 +157,9 @@ PrintDependentIDsCommand::make_doc_cmdline() return std::make_shared<PrintDependentIDsCommandLine>(); } +CommandImportance +PrintDependentIDsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_dependent_ids.hh b/src/clients/cave/cmd_print_dependent_ids.hh index f8b1402a1..86dbe7605 100644 --- a/src/clients/cave/cmd_print_dependent_ids.hh +++ b/src/clients/cave/cmd_print_dependent_ids.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_environment_metadata.cc b/src/clients/cave/cmd_print_environment_metadata.cc index 8c370775c..c5ee16ab1 100644 --- a/src/clients/cave/cmd_print_environment_metadata.cc +++ b/src/clients/cave/cmd_print_environment_metadata.cc @@ -142,3 +142,9 @@ PrintEnvironmentMetadataCommand::make_doc_cmdline() return std::make_shared<PrintEnvironmentMetadataCommandLine>(); } +CommandImportance +PrintEnvironmentMetadataCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_environment_metadata.hh b/src/clients/cave/cmd_print_environment_metadata.hh index 06a7d63d7..43f071352 100644 --- a/src/clients/cave/cmd_print_environment_metadata.hh +++ b/src/clients/cave/cmd_print_environment_metadata.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_actions.cc b/src/clients/cave/cmd_print_id_actions.cc index 473dfee13..76678d037 100644 --- a/src/clients/cave/cmd_print_id_actions.cc +++ b/src/clients/cave/cmd_print_id_actions.cc @@ -138,3 +138,9 @@ PrintIDActionsCommand::make_doc_cmdline() return std::make_shared<PrintIDActionsCommandLine>(); } +CommandImportance +PrintIDActionsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_actions.hh b/src/clients/cave/cmd_print_id_actions.hh index dee40146b..32e155c5e 100644 --- a/src/clients/cave/cmd_print_id_actions.hh +++ b/src/clients/cave/cmd_print_id_actions.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc index f60db7c4f..61e1b9195 100644 --- a/src/clients/cave/cmd_print_id_contents.cc +++ b/src/clients/cave/cmd_print_id_contents.cc @@ -192,3 +192,9 @@ PrintIDContentsCommand::make_doc_cmdline() return std::make_shared<PrintContentsCommandLine>(); } +CommandImportance +PrintIDContentsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_contents.hh b/src/clients/cave/cmd_print_id_contents.hh index 6db7c29fa..aabde60b2 100644 --- a/src/clients/cave/cmd_print_id_contents.hh +++ b/src/clients/cave/cmd_print_id_contents.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_environment_variable.cc b/src/clients/cave/cmd_print_id_environment_variable.cc index 9e7b372f6..e98d549a1 100644 --- a/src/clients/cave/cmd_print_id_environment_variable.cc +++ b/src/clients/cave/cmd_print_id_environment_variable.cc @@ -162,3 +162,9 @@ PrintIDEnvironmentVariableCommand::make_doc_cmdline() return std::make_shared<PrintIDEnvironmentVariableCommandLine>(); } +CommandImportance +PrintIDEnvironmentVariableCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_environment_variable.hh b/src/clients/cave/cmd_print_id_environment_variable.hh index 044dce448..26bbda466 100644 --- a/src/clients/cave/cmd_print_id_environment_variable.hh +++ b/src/clients/cave/cmd_print_id_environment_variable.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_executables.cc b/src/clients/cave/cmd_print_id_executables.cc index 4a18af79a..898e9c8cf 100644 --- a/src/clients/cave/cmd_print_id_executables.cc +++ b/src/clients/cave/cmd_print_id_executables.cc @@ -106,3 +106,9 @@ PrintIDExecutablesCommand::make_doc_cmdline() return std::make_shared<PrintIDExecutablesCommandLine>(); } +CommandImportance +PrintIDExecutablesCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_executables.hh b/src/clients/cave/cmd_print_id_executables.hh index 58021afb7..0eaea9f04 100644 --- a/src/clients/cave/cmd_print_id_executables.hh +++ b/src/clients/cave/cmd_print_id_executables.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_masks.cc b/src/clients/cave/cmd_print_id_masks.cc index 135c67e7f..b3d026011 100644 --- a/src/clients/cave/cmd_print_id_masks.cc +++ b/src/clients/cave/cmd_print_id_masks.cc @@ -222,3 +222,9 @@ PrintIDMasksCommand::make_doc_cmdline() return std::make_shared<PrintIDMasksCommandLine>(); } +CommandImportance +PrintIDMasksCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_masks.hh b/src/clients/cave/cmd_print_id_masks.hh index 44701bbbd..d005ef66f 100644 --- a/src/clients/cave/cmd_print_id_masks.hh +++ b/src/clients/cave/cmd_print_id_masks.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_metadata.cc b/src/clients/cave/cmd_print_id_metadata.cc index 2b3b78e99..3068ea462 100644 --- a/src/clients/cave/cmd_print_id_metadata.cc +++ b/src/clients/cave/cmd_print_id_metadata.cc @@ -176,3 +176,9 @@ PrintIDMetadataCommand::make_doc_cmdline() return std::make_shared<PrintIDMetadataCommandLine>(); } +CommandImportance +PrintIDMetadataCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_metadata.hh b/src/clients/cave/cmd_print_id_metadata.hh index e72bc1ced..bc9fa40c5 100644 --- a/src/clients/cave/cmd_print_id_metadata.hh +++ b/src/clients/cave/cmd_print_id_metadata.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_id_size.cc b/src/clients/cave/cmd_print_id_size.cc index 03c3c234b..563310d1a 100644 --- a/src/clients/cave/cmd_print_id_size.cc +++ b/src/clients/cave/cmd_print_id_size.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -91,3 +91,9 @@ PrintIDSizeCommand::make_doc_cmdline() return std::make_shared<PrintIDSizeCommandLine>(); } +CommandImportance +PrintIDSizeCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_id_size.hh b/src/clients/cave/cmd_print_id_size.hh index 4da02185f..1e31953d8 100644 --- a/src/clients/cave/cmd_print_id_size.hh +++ b/src/clients/cave/cmd_print_id_size.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc index eed70f1e1..4abfa66f4 100644 --- a/src/clients/cave/cmd_print_ids.cc +++ b/src/clients/cave/cmd_print_ids.cc @@ -350,3 +350,9 @@ PrintIDsCommand::make_doc_cmdline() return std::make_shared<PrintIDsCommandLine>(); } +CommandImportance +PrintIDsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_ids.hh b/src/clients/cave/cmd_print_ids.hh index 5dac13823..3cbb7ff36 100644 --- a/src/clients/cave/cmd_print_ids.hh +++ b/src/clients/cave/cmd_print_ids.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_owners.cc b/src/clients/cave/cmd_print_owners.cc index 15d5afa91..6a89ac0b3 100644 --- a/src/clients/cave/cmd_print_owners.cc +++ b/src/clients/cave/cmd_print_owners.cc @@ -2,7 +2,7 @@ /* * Copyright (c) 2008 Alexander Færøy - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -101,3 +101,9 @@ PrintOwnersCommand::make_doc_cmdline() return std::make_shared<PrintOwnersCommandLine>(); } +CommandImportance +PrintOwnersCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_owners.hh b/src/clients/cave/cmd_print_owners.hh index 23064195e..9b52ec9b0 100644 --- a/src/clients/cave/cmd_print_owners.hh +++ b/src/clients/cave/cmd_print_owners.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_packages.cc b/src/clients/cave/cmd_print_packages.cc index 0fb64d43b..f07b76fb5 100644 --- a/src/clients/cave/cmd_print_packages.cc +++ b/src/clients/cave/cmd_print_packages.cc @@ -126,3 +126,9 @@ PrintPackagesCommand::make_doc_cmdline() { return std::make_shared<PrintPackagesCommandLine>(); } +CommandImportance +PrintPackagesCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_packages.hh b/src/clients/cave/cmd_print_packages.hh index bea80f527..0628663df 100644 --- a/src/clients/cave/cmd_print_packages.hh +++ b/src/clients/cave/cmd_print_packages.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_repositories.cc b/src/clients/cave/cmd_print_repositories.cc index 841d0c997..56d14e2fc 100644 --- a/src/clients/cave/cmd_print_repositories.cc +++ b/src/clients/cave/cmd_print_repositories.cc @@ -123,3 +123,9 @@ PrintRepositoriesCommand::make_doc_cmdline() { return std::make_shared<PrintRepositoriesCommandLine>(); } +CommandImportance +PrintRepositoriesCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_repositories.hh b/src/clients/cave/cmd_print_repositories.hh index 29a9aed86..9f20fd088 100644 --- a/src/clients/cave/cmd_print_repositories.hh +++ b/src/clients/cave/cmd_print_repositories.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_repository_formats.cc b/src/clients/cave/cmd_print_repository_formats.cc index 5b89af6c3..942c9bb9d 100644 --- a/src/clients/cave/cmd_print_repository_formats.cc +++ b/src/clients/cave/cmd_print_repository_formats.cc @@ -94,3 +94,9 @@ PrintRepositoryFormatsCommand::make_doc_cmdline() { return std::make_shared<PrintRepositoryFormatsCommandLine>(); } +CommandImportance +PrintRepositoryFormatsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_repository_formats.hh b/src/clients/cave/cmd_print_repository_formats.hh index 5e16be45e..71ca24456 100644 --- a/src/clients/cave/cmd_print_repository_formats.hh +++ b/src/clients/cave/cmd_print_repository_formats.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_repository_metadata.cc b/src/clients/cave/cmd_print_repository_metadata.cc index 2a5aa2406..c0a25cae5 100644 --- a/src/clients/cave/cmd_print_repository_metadata.cc +++ b/src/clients/cave/cmd_print_repository_metadata.cc @@ -148,3 +148,9 @@ PrintRepositoryMetadataCommand::make_doc_cmdline() return std::make_shared<PrintRepositoryMetadataCommandLine>(); } +CommandImportance +PrintRepositoryMetadataCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_repository_metadata.hh b/src/clients/cave/cmd_print_repository_metadata.hh index 73ed7f25e..e07b70d1e 100644 --- a/src/clients/cave/cmd_print_repository_metadata.hh +++ b/src/clients/cave/cmd_print_repository_metadata.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_set.cc b/src/clients/cave/cmd_print_set.cc index eca313196..181d4dbbe 100644 --- a/src/clients/cave/cmd_print_set.cc +++ b/src/clients/cave/cmd_print_set.cc @@ -155,3 +155,9 @@ PrintSetCommand::make_doc_cmdline() return std::make_shared<PrintSetCommandLine>(); } +CommandImportance +PrintSetCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_set.hh b/src/clients/cave/cmd_print_set.hh index 32294fc92..270937df9 100644 --- a/src/clients/cave/cmd_print_set.hh +++ b/src/clients/cave/cmd_print_set.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_sets.cc b/src/clients/cave/cmd_print_sets.cc index 0df75faf1..c307bb886 100644 --- a/src/clients/cave/cmd_print_sets.cc +++ b/src/clients/cave/cmd_print_sets.cc @@ -90,3 +90,9 @@ PrintSetsCommand::make_doc_cmdline() { return std::make_shared<PrintSetsCommandLine>(); } +CommandImportance +PrintSetsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_sets.hh b/src/clients/cave/cmd_print_sets.hh index 14632ab21..4a4c33f2a 100644 --- a/src/clients/cave/cmd_print_sets.hh +++ b/src/clients/cave/cmd_print_sets.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_spec.cc b/src/clients/cave/cmd_print_spec.cc index 2c7a2c43d..00124bda7 100644 --- a/src/clients/cave/cmd_print_spec.cc +++ b/src/clients/cave/cmd_print_spec.cc @@ -295,3 +295,9 @@ PrintSpecCommand::make_doc_cmdline() return std::make_shared<PrintSpecCommandLine>(); } +CommandImportance +PrintSpecCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_spec.hh b/src/clients/cave/cmd_print_spec.hh index e614c4e65..b5be4cf97 100644 --- a/src/clients/cave/cmd_print_spec.hh +++ b/src/clients/cave/cmd_print_spec.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_sync_protocols.cc b/src/clients/cave/cmd_print_sync_protocols.cc index 97a4a6cb8..d6f1bc176 100644 --- a/src/clients/cave/cmd_print_sync_protocols.cc +++ b/src/clients/cave/cmd_print_sync_protocols.cc @@ -115,3 +115,9 @@ PrintSyncProtocolsCommand::make_doc_cmdline() return std::make_shared<PrintSyncProtocolsCommandLine>(); } +CommandImportance +PrintSyncProtocolsCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_sync_protocols.hh b/src/clients/cave/cmd_print_sync_protocols.hh index ee59e2043..2287b61cb 100644 --- a/src/clients/cave/cmd_print_sync_protocols.hh +++ b/src/clients/cave/cmd_print_sync_protocols.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_print_unused_distfiles.cc b/src/clients/cave/cmd_print_unused_distfiles.cc index 59c15522b..489a3ebd5 100644 --- a/src/clients/cave/cmd_print_unused_distfiles.cc +++ b/src/clients/cave/cmd_print_unused_distfiles.cc @@ -227,3 +227,9 @@ PrintUnusedDistfilesCommand::make_doc_cmdline() return std::make_shared<PrintUnusedDistfilesCommandLine>(); } +CommandImportance +PrintUnusedDistfilesCommand::importance() const +{ + return ci_scripting; +} + diff --git a/src/clients/cave/cmd_print_unused_distfiles.hh b/src/clients/cave/cmd_print_unused_distfiles.hh index 812ad365a..2eb082762 100644 --- a/src/clients/cave/cmd_print_unused_distfiles.hh +++ b/src/clients/cave/cmd_print_unused_distfiles.hh @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_purge.cc b/src/clients/cave/cmd_purge.cc index 737df7031..b67dc9592 100644 --- a/src/clients/cave/cmd_purge.cc +++ b/src/clients/cave/cmd_purge.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -83,12 +83,6 @@ namespace }; } -bool -PurgeCommand::important() const -{ - return true; -} - int PurgeCommand::run( const std::shared_ptr<Environment> & env, @@ -123,3 +117,9 @@ PurgeCommand::make_doc_cmdline() return std::make_shared<PurgeCommandLine>(true); } +CommandImportance +PurgeCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_purge.hh b/src/clients/cave/cmd_purge.hh index 8fcb85719..52e261d03 100644 --- a/src/clients/cave/cmd_purge.hh +++ b/src/clients/cave/cmd_purge.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,14 +30,14 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args ); std::shared_ptr<args::ArgsHandler> make_doc_cmdline(); - - bool important() const; }; } } diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc index 511dabf67..2376752ec 100644 --- a/src/clients/cave/cmd_report.cc +++ b/src/clients/cave/cmd_report.cc @@ -152,12 +152,6 @@ namespace } } -bool -ReportCommand::important() const -{ - return true; -} - int ReportCommand::run( const std::shared_ptr<Environment> & env, @@ -259,3 +253,9 @@ ReportCommand::make_doc_cmdline() return std::make_shared<ReportCommandLine>(); } +CommandImportance +ReportCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_report.hh b/src/clients/cave/cmd_report.hh index ca9d92529..dcbc57d03 100644 --- a/src/clients/cave/cmd_report.hh +++ b/src/clients/cave/cmd_report.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc index 7845acb46..e0a7f2a4c 100644 --- a/src/clients/cave/cmd_resolve.cc +++ b/src/clients/cave/cmd_resolve.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -74,12 +74,6 @@ namespace }; } -bool -ResolveCommand::important() const -{ - return true; -} - int ResolveCommand::run( const std::shared_ptr<Environment> & env, @@ -113,3 +107,9 @@ ResolveCommand::make_doc_cmdline() return std::make_shared<ResolveCommandLine>(); } +CommandImportance +ResolveCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_resolve.hh b/src/clients/cave/cmd_resolve.hh index f31f9df4a..4903f8c9b 100644 --- a/src/clients/cave/cmd_resolve.hh +++ b/src/clients/cave/cmd_resolve.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 2009, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_resume.cc b/src/clients/cave/cmd_resume.cc index 8a32497de..48f87df55 100644 --- a/src/clients/cave/cmd_resume.cc +++ b/src/clients/cave/cmd_resume.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -247,12 +247,6 @@ namespace } } -bool -ResumeCommand::important() const -{ - return true; -} - int ResumeCommand::run( const std::shared_ptr<Environment> & env, @@ -292,3 +286,9 @@ ResumeCommand::make_doc_cmdline() return std::make_shared<ResumeCommandLine>(); } +CommandImportance +ResumeCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_resume.hh b/src/clients/cave/cmd_resume.hh index 5750997bd..463ee5fc9 100644 --- a/src/clients/cave/cmd_resume.hh +++ b/src/clients/cave/cmd_resume.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -31,7 +31,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_search.cc b/src/clients/cave/cmd_search.cc index dd8476d6e..1a36dd0f4 100644 --- a/src/clients/cave/cmd_search.cc +++ b/src/clients/cave/cmd_search.cc @@ -254,12 +254,6 @@ namespace } } -bool -SearchCommand::important() const -{ - return true; -} - int SearchCommand::run( const std::shared_ptr<Environment> & env, @@ -357,3 +351,9 @@ SearchCommand::make_doc_cmdline() return std::make_shared<SearchCommandLine>(); } +CommandImportance +SearchCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_search.hh b/src/clients/cave/cmd_search.hh index 391fecb57..00a1adede 100644 --- a/src/clients/cave/cmd_search.hh +++ b/src/clients/cave/cmd_search.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc index 5e31344e0..9b086cfc7 100644 --- a/src/clients/cave/cmd_show.cc +++ b/src/clients/cave/cmd_show.cc @@ -1347,12 +1347,6 @@ namespace } } -bool -ShowCommand::important() const -{ - return true; -} - int ShowCommand::run( const std::shared_ptr<Environment> & env, @@ -1433,3 +1427,9 @@ ShowCommand::make_doc_cmdline() return std::make_shared<ShowCommandLine>(); } +CommandImportance +ShowCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_show.hh b/src/clients/cave/cmd_show.hh index eab97e66b..13029d57c 100644 --- a/src/clients/cave/cmd_show.hh +++ b/src/clients/cave/cmd_show.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_size.cc b/src/clients/cave/cmd_size.cc index ee18932a2..fed10c289 100644 --- a/src/clients/cave/cmd_size.cc +++ b/src/clients/cave/cmd_size.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -91,3 +91,9 @@ SizeCommand::make_doc_cmdline() return std::make_shared<SizeCommandLine>(); } +CommandImportance +SizeCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_size.hh b/src/clients/cave/cmd_size.hh index 9937f7922..b4970de97 100644 --- a/src/clients/cave/cmd_size.hh +++ b/src/clients/cave/cmd_size.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc index 896497462..b8f17b64f 100644 --- a/src/clients/cave/cmd_sync.cc +++ b/src/clients/cave/cmd_sync.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -349,12 +349,6 @@ namespace } } -bool -SyncCommand::important() const -{ - return true; -} - int SyncCommand::run( const std::shared_ptr<Environment> & env, @@ -423,3 +417,9 @@ SyncCommand::make_doc_cmdline() return std::make_shared<SyncCommandLine>(); } +CommandImportance +SyncCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_sync.hh b/src/clients/cave/cmd_sync.hh index f67d1d713..7b189603a 100644 --- a/src/clients/cave/cmd_sync.hh +++ b/src/clients/cave/cmd_sync.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,7 +30,7 @@ namespace paludis public Command { public: - bool important() const; + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/cmd_sync_protocol_options.cc b/src/clients/cave/cmd_sync_protocol_options.cc index 68b6b116e..4a089a0be 100644 --- a/src/clients/cave/cmd_sync_protocol_options.cc +++ b/src/clients/cave/cmd_sync_protocol_options.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -120,3 +120,9 @@ SyncProtocolOptionsCommand::make_doc_cmdline() return std::make_shared<SyncProtocolOptionsCommandLine>(); } +CommandImportance +SyncProtocolOptionsCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_sync_protocol_options.hh b/src/clients/cave/cmd_sync_protocol_options.hh index 2fe521607..00ba25996 100644 --- a/src/clients/cave/cmd_sync_protocol_options.hh +++ b/src/clients/cave/cmd_sync_protocol_options.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc index b6a52db1b..6da009bcf 100644 --- a/src/clients/cave/cmd_uninstall.cc +++ b/src/clients/cave/cmd_uninstall.cc @@ -108,12 +108,6 @@ namespace } } -bool -UninstallCommand::important() const -{ - return true; -} - int UninstallCommand::run( const std::shared_ptr<Environment> & env, @@ -199,3 +193,9 @@ UninstallCommand::make_doc_cmdline() return std::make_shared<UninstallCommandLine>(true); } +CommandImportance +UninstallCommand::importance() const +{ + return ci_core; +} + diff --git a/src/clients/cave/cmd_uninstall.hh b/src/clients/cave/cmd_uninstall.hh index 654cc0b5d..e9f5c4024 100644 --- a/src/clients/cave/cmd_uninstall.hh +++ b/src/clients/cave/cmd_uninstall.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,14 +30,14 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args ); std::shared_ptr<args::ArgsHandler> make_doc_cmdline(); - - bool important() const; }; } } diff --git a/src/clients/cave/cmd_update_world.cc b/src/clients/cave/cmd_update_world.cc index 995c30115..08d6553a6 100644 --- a/src/clients/cave/cmd_update_world.cc +++ b/src/clients/cave/cmd_update_world.cc @@ -176,3 +176,9 @@ UpdateWorldCommand::make_doc_cmdline() return std::make_shared<UpdateWorldCommandLine>(); } +CommandImportance +UpdateWorldCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_update_world.hh b/src/clients/cave/cmd_update_world.hh index ba44dfb6f..c70352edb 100644 --- a/src/clients/cave/cmd_update_world.hh +++ b/src/clients/cave/cmd_update_world.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 2009, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc index 4d2200481..c1a9358bc 100644 --- a/src/clients/cave/cmd_verify.cc +++ b/src/clients/cave/cmd_verify.cc @@ -244,3 +244,9 @@ VerifyCommand::make_doc_cmdline() return std::make_shared<VerifyCommandLine>(); } +CommandImportance +VerifyCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/cmd_verify.hh b/src/clients/cave/cmd_verify.hh index 6d1b73ea6..8579214e7 100644 --- a/src/clients/cave/cmd_verify.hh +++ b/src/clients/cave/cmd_verify.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2010 Ciaran McCreesh + * Copyright (c) 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -30,6 +30,8 @@ namespace paludis public Command { public: + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)); + int run( const std::shared_ptr<Environment> &, const std::shared_ptr<const Sequence<std::string > > & args diff --git a/src/clients/cave/command.cc b/src/clients/cave/command.cc index d337ba198..659b4c1e3 100644 --- a/src/clients/cave/command.cc +++ b/src/clients/cave/command.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -26,9 +26,3 @@ Command::~Command() { } -bool -Command::important() const -{ - return false; -} - diff --git a/src/clients/cave/command.hh b/src/clients/cave/command.hh index 8768f5aaa..42171447f 100644 --- a/src/clients/cave/command.hh +++ b/src/clients/cave/command.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -29,12 +29,22 @@ namespace paludis { namespace cave { + enum CommandImportance + { + ci_core, + ci_supplemental, + ci_development, + ci_scripting, + ci_internal, + last_ci + }; + class PALUDIS_VISIBLE Command { public: virtual ~Command() = 0; - virtual bool important() const PALUDIS_ATTRIBUTE((warn_unused_result)); + virtual CommandImportance importance() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0; virtual int run( const std::shared_ptr<Environment> &, diff --git a/src/clients/cave/command_line.cc b/src/clients/cave/command_line.cc index a4cbe8fff..87cd9e30d 100644 --- a/src/clients/cave/command_line.cc +++ b/src/clients/cave/command_line.cc @@ -19,6 +19,7 @@ #include "command_line.hh" #include "command_factory.hh" +#include <paludis/util/enum_iterator.hh> using namespace paludis; using namespace cave; @@ -56,10 +57,11 @@ CaveCommandLine::CaveCommandLine() : add_environment_variable("CAVE_COMMANDS_PATH", "Colon-separated paths in which to look for " "additional commands."); - for (int pass(0) ; pass != 2 ; ++pass) + for (EnumIterator<CommandImportance> i, i_end(last_ci) ; + i != i_end ; ++i) for (CommandFactory::ConstIterator c(CommandFactory::get_instance()->begin()), c_end(CommandFactory::get_instance()->end()) ; c != c_end ; ++c) - if (CommandFactory::get_instance()->create(*c)->important() == (0 == pass)) + if (CommandFactory::get_instance()->create(*c)->importance() == *i) add_see_also("cave-" + *c, 1); } diff --git a/src/clients/cave/script_command.cc b/src/clients/cave/script_command.cc index e3e0f6da7..1990b25ae 100644 --- a/src/clients/cave/script_command.cc +++ b/src/clients/cave/script_command.cc @@ -84,3 +84,9 @@ ScriptCommand::make_doc_cmdline() throw InternalError(PALUDIS_HERE, "no script cmdline"); } +CommandImportance +ScriptCommand::importance() const +{ + return ci_supplemental; +} + diff --git a/src/clients/cave/script_command.hh b/src/clients/cave/script_command.hh index 1ee4a2c4f..39132fc48 100644 --- a/src/clients/cave/script_command.hh +++ b/src/clients/cave/script_command.hh @@ -43,6 +43,8 @@ namespace paludis const std::shared_ptr<const Sequence<std::string > > & args ) PALUDIS_ATTRIBUTE((noreturn)); + virtual CommandImportance importance() const; + std::shared_ptr<args::ArgsHandler> make_doc_cmdline() PALUDIS_ATTRIBUTE((noreturn)); }; } |