aiee

Python modules for common command line interfacing utils
git clone git://git.defalsify.org/aiee.git
Log | Files | Refs | LICENSE

commit 9803bdddea3563e2cdacb9708f9e60486640a529
parent eadfc3532e835c5d9b2f7367029417916ac8d7c7
Author: lash <dev@holbrook.no>
Date:   Thu, 12 May 2022 08:06:40 +0000

Allow numeric flags in more, less

Diffstat:
Maiee/arg.py | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/aiee/arg.py b/aiee/arg.py @@ -72,16 +72,22 @@ class ArgFlag: def less(self, k, v): - k = to_key(k) - flags = getattr(self, k) + try: + k = to_key(k) + flags = getattr(self, k) + except TypeError: + flags = k mask = ~(self.__all & v) r = flags & mask return r def more(self, k, v): - k = to_key(k) - flags = getattr(self, k) + try: + k = to_key(k) + flags = getattr(self, k) + except TypeError: + flags = k return flags | v