aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2010-06-23 21:51:37 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2010-06-23 21:51:51 +0100
commit8867502dc820313cc1c48d12f4403b8ff26bfb1b (patch)
tree58bb4a872ded3b0681d3b27b6307cc9ed505e825
parent3a4593137fc07edc1db7895ff4deac719f3e630b (diff)
downloadpaludis-8867502dc820313cc1c48d12f4403b8ff26bfb1b.tar.gz
paludis-8867502dc820313cc1c48d12f4403b8ff26bfb1b.tar.xz
Allow removing an ArgsGroup from an ArgsSection
-rw-r--r--paludis/args/args_group.cc6
-rw-r--r--paludis/args/args_group.hh5
-rw-r--r--paludis/args/args_section.cc6
-rw-r--r--paludis/args/args_section.hh1
4 files changed, 18 insertions, 0 deletions
diff --git a/paludis/args/args_group.cc b/paludis/args/args_group.cc
index 0efd6c4..98800bc 100644
--- a/paludis/args/args_group.cc
+++ b/paludis/args/args_group.cc
@@ -57,6 +57,12 @@ ArgsGroup::ArgsGroup(ArgsSection * s, const std::string & our_name,
}
void
+ArgsGroup::remove()
+{
+ _section->remove(this);
+}
+
+void
ArgsGroup::add(ArgsOption * const value)
{
/// \bug Should check for uniqueness of short and long names.
diff --git a/paludis/args/args_group.hh b/paludis/args/args_group.hh
index 7087f8d..786055d 100644
--- a/paludis/args/args_group.hh
+++ b/paludis/args/args_group.hh
@@ -60,6 +60,11 @@ namespace paludis
public:
/**
+ * Remove this group from our section.
+ */
+ void remove();
+
+ /**
* Fetch our section.
*/
ArgsSection * section() const
diff --git a/paludis/args/args_section.cc b/paludis/args/args_section.cc
index 51d28ba..fba4ca3 100644
--- a/paludis/args/args_section.cc
+++ b/paludis/args/args_section.cc
@@ -78,6 +78,12 @@ ArgsSection::add(ArgsGroup * const g)
_imp->groups.push_back(g);
}
+void
+ArgsSection::remove(ArgsGroup * const g)
+{
+ _imp->groups.remove(g);
+}
+
ArgsHandler *
ArgsSection::handler() const
{
diff --git a/paludis/args/args_section.hh b/paludis/args/args_section.hh
index 24ad067..331cf0b 100644
--- a/paludis/args/args_section.hh
+++ b/paludis/args/args_section.hh
@@ -54,6 +54,7 @@ namespace paludis
const std::string name() const PALUDIS_ATTRIBUTE((warn_unused_result));
void add(ArgsGroup * const);
+ void remove(ArgsGroup * const);
};
}