commit ac1d138a547099d24e3dea0f8dc3b8fe1e0bc7e2
parent bd2dfb3ad91d71567f8750dc7678943131ecf02a
Author: lash <dev@holbrook.no>
Date: Sat, 19 Aug 2023 16:33:56 +0100
Add dict iterator to arg flag
Diffstat:
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG b/CHANGELOG
@@ -1,3 +1,7 @@
+- 0.3.2
+ * Add dict iterator to argflag
+- 0.3.1
+ * (TODO)
- 0.3.0
* Force integer output
- 0.2.0
diff --git a/aiee/arg.py b/aiee/arg.py
@@ -27,6 +27,17 @@ class ArgFlag:
return self.__all
+ def __iter__(self):
+ r = {}
+ for v in self.__pure:
+ yield v, self.val(v)
+ for k in self.__alias:
+ v = self.val(k)
+ k += '=' + ','.join(self.names(v))
+ yield k, v
+ return r
+
+
def val(self, v):
if isinstance(v, int):
if self.__reverse.get(v) == None:
diff --git a/setup.cfg b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = aiee
-version = 0.3.1
+version = 0.3.2
description = Common command line interfacing utils
author = Louis Holbrook
author_email = dev@holbrook.no