Compare commits
No commits in common. 'c9' and 'c10-beta' have entirely different histories.
@ -1 +1 @@
|
|||||||
SOURCES/v0.13.71-pruned.tar.gz
|
SOURCES/v0.13.74.tar.gz
|
||||||
|
@ -1 +1 @@
|
|||||||
8f4b65912e109f1841387a67b47a4626aca129bb SOURCES/v0.13.71-pruned.tar.gz
|
7691e6aa7f82600de7958bf359e82420d0596e31 SOURCES/v0.13.74.tar.gz
|
||||||
|
@ -1,218 +0,0 @@
|
|||||||
From ac9ae39ef419e9f0f83da1e583314d8c7cda34a6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:48:45 +0100
|
|
||||||
Subject: [PATCH 1/7] #68 ssize_t return value of zzip_file_read is a signed
|
|
||||||
value being possibly -1
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/unzzipcat-zip.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/bins/unzzipcat-zip.c b/bins/unzzipcat-zip.c
|
|
||||||
index dd78c2b..385aeaf 100644
|
|
||||||
--- a/bins/unzzipcat-zip.c
|
|
||||||
+++ b/bins/unzzipcat-zip.c
|
|
||||||
@@ -34,7 +34,7 @@ static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_file_read (file, buffer, 1024)))
|
|
||||||
+ while (0 < (len = zzip_file_read (file, buffer, 1024)))
|
|
||||||
{
|
|
||||||
fwrite (buffer, 1, len, out);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
||||||
From 7e786544084548da7fcfcd9090d3c4e7f5777f7e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:50:26 +0100
|
|
||||||
Subject: [PATCH 2/7] #68 return value of zzip_mem_disk_fread is signed
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/unzip-mem.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/bins/unzip-mem.c b/bins/unzip-mem.c
|
|
||||||
index cc009f8..50eb5a6 100644
|
|
||||||
--- a/bins/unzip-mem.c
|
|
||||||
+++ b/bins/unzip-mem.c
|
|
||||||
@@ -81,7 +81,7 @@ static void zzip_mem_entry_pipe(ZZIP_MEM_DISK* disk,
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file)))
|
|
||||||
+ while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file)))
|
|
||||||
fwrite (buffer, len, 1, out);
|
|
||||||
|
|
||||||
zzip_mem_disk_fclose (file);
|
|
||||||
@@ -115,7 +115,7 @@ static void zzip_mem_entry_test(ZZIP_MEM_DISK* disk,
|
|
||||||
{
|
|
||||||
unsigned long crc = crc32 (0L, NULL, 0);
|
|
||||||
unsigned char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file))) {
|
|
||||||
+ while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file))) {
|
|
||||||
crc = crc32 (crc, buffer, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
||||||
From d453977f59ca59c61bf59dec28dd724498828f2a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:51:12 +0100
|
|
||||||
Subject: [PATCH 3/7] #68 return value of zzip_entry_fread is signed
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/unzzipcat-big.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/bins/unzzipcat-big.c b/bins/unzzipcat-big.c
|
|
||||||
index 111ef47..ecebe11 100644
|
|
||||||
--- a/bins/unzzipcat-big.c
|
|
||||||
+++ b/bins/unzzipcat-big.c
|
|
||||||
@@ -26,7 +26,7 @@ static void unzzip_big_entry_fprint(ZZIP_ENTRY* entry, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
+ while (0 < (len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
{
|
|
||||||
DBG2("entry read %i", len);
|
|
||||||
fwrite (buffer, len, 1, out);
|
|
||||||
@@ -45,7 +45,7 @@ static void unzzip_cat_file(FILE* disk, char* name, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
+ while (0 < (len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
fwrite (buffer, len, 1, out);
|
|
||||||
|
|
||||||
zzip_entry_fclose (file);
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
||||||
From 0a9db9ded9d15fbdb63bf5cf451920d0a368c00e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:51:56 +0100
|
|
||||||
Subject: [PATCH 4/7] #68 return value of zzip_mem_disk_fread is signed
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/unzzipcat-mem.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/bins/unzzipcat-mem.c b/bins/unzzipcat-mem.c
|
|
||||||
index 6bd79b7..1b5bc22 100644
|
|
||||||
--- a/bins/unzzipcat-mem.c
|
|
||||||
+++ b/bins/unzzipcat-mem.c
|
|
||||||
@@ -35,7 +35,7 @@ static void unzzip_mem_entry_fprint(ZZIP_MEM_DISK* disk,
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file)))
|
|
||||||
+ while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file)))
|
|
||||||
fwrite (buffer, len, 1, out);
|
|
||||||
|
|
||||||
zzip_mem_disk_fclose (file);
|
|
||||||
@@ -48,7 +48,7 @@ static void unzzip_mem_disk_cat_file(ZZIP_MEM_DISK* disk, char* name, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1025]; int len;
|
|
||||||
- while ((len = zzip_mem_disk_fread (buffer, 1, 1024, file)))
|
|
||||||
+ while (0 < (len = zzip_mem_disk_fread (buffer, 1, 1024, file)))
|
|
||||||
{
|
|
||||||
fwrite (buffer, 1, len, out);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
||||||
From a34a96fbda1e58fbec5c79f4c0b5063e031ce11d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:52:47 +0100
|
|
||||||
Subject: [PATCH 5/7] #68 return value of zzip_fread is signed
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/unzzipcat-mix.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/bins/unzzipcat-mix.c b/bins/unzzipcat-mix.c
|
|
||||||
index e18987d..8f3d0b8 100644
|
|
||||||
--- a/bins/unzzipcat-mix.c
|
|
||||||
+++ b/bins/unzzipcat-mix.c
|
|
||||||
@@ -34,7 +34,7 @@ static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_fread (buffer, 1, 1024, file)))
|
|
||||||
+ while (0 < (len = zzip_fread (buffer, 1, 1024, file)))
|
|
||||||
{
|
|
||||||
fwrite (buffer, 1, len, out);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
||||||
From fa1f78abe1b08544061204019016809664f2618c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:53:50 +0100
|
|
||||||
Subject: [PATCH 6/7] #68 return value of zzip_entry_fread is signed
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/unzzipshow.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/bins/unzzipshow.c b/bins/unzzipshow.c
|
|
||||||
index 9d8c2ed..5672d3b 100644
|
|
||||||
--- a/bins/unzzipshow.c
|
|
||||||
+++ b/bins/unzzipshow.c
|
|
||||||
@@ -22,7 +22,7 @@ static void zzip_entry_fprint(ZZIP_ENTRY* entry, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
+ while (0 < (len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
fwrite (buffer, len, 1, out);
|
|
||||||
|
|
||||||
zzip_entry_fclose (file);
|
|
||||||
@@ -35,7 +35,7 @@ static void zzip_cat_file(FILE* disk, char* name, FILE* out)
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
char buffer[1024]; int len;
|
|
||||||
- while ((len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
+ while (0 < (len = zzip_entry_fread (buffer, 1024, 1, file)))
|
|
||||||
fwrite (buffer, len, 1, out);
|
|
||||||
|
|
||||||
zzip_entry_fclose (file);
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
||||||
|
|
||||||
From f7a6fa9f0c29aecb4c2299568ed2e6094c34aca7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 4 Jan 2021 21:55:08 +0100
|
|
||||||
Subject: [PATCH 7/7] #68 return value of posix read(2) is signed
|
|
||||||
|
|
||||||
---
|
|
||||||
bins/zzipmake-zip.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/bins/zzipmake-zip.c b/bins/zzipmake-zip.c
|
|
||||||
index 8e09c31..b37877c 100644
|
|
||||||
--- a/bins/zzipmake-zip.c
|
|
||||||
+++ b/bins/zzipmake-zip.c
|
|
||||||
@@ -57,7 +57,7 @@ int rezzip_make (int argc, char ** argv)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
- while ((n = read (input, buf, 16)))
|
|
||||||
+ while (0 < (n = read (input, buf, 16)))
|
|
||||||
{
|
|
||||||
zzip_write (output, buf, n);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
From 803f49aaae16b7f2899e4769afdfc673a21fa9e8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Guido Draheim <guidod@gmx.de>
|
|
||||||
Date: Mon, 26 Feb 2024 23:17:12 +0100
|
|
||||||
Subject: [PATCH] #69 assert full zzip_file_header
|
|
||||||
|
|
||||||
---
|
|
||||||
zzip/mmapped.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/zzip/mmapped.c b/zzip/mmapped.c
|
|
||||||
index 2071882..306ba51 100644
|
|
||||||
--- a/zzip/mmapped.c
|
|
||||||
+++ b/zzip/mmapped.c
|
|
||||||
@@ -276,7 +276,8 @@ struct zzip_file_header *
|
|
||||||
zzip_disk_entry_to_file_header(ZZIP_DISK * disk, struct zzip_disk_entry *entry)
|
|
||||||
{
|
|
||||||
zzip_byte_t *const ptr = disk->buffer + zzip_disk_entry_fileoffset(entry);
|
|
||||||
- if (disk->buffer > ptr || ptr >= disk->endbuf)
|
|
||||||
+ zzip_byte_t *const end = ptr + sizeof(struct zzip_file_header);
|
|
||||||
+ if (disk->buffer > ptr || end >= disk->endbuf || end <= NULL)
|
|
||||||
{
|
|
||||||
errno = EBADMSG;
|
|
||||||
return 0;
|
|
@ -1,108 +0,0 @@
|
|||||||
#! /usr/bin/env python3
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
try:
|
|
||||||
basestring
|
|
||||||
except NameError:
|
|
||||||
basestring = str
|
|
||||||
|
|
||||||
# ---------------------------------------------------------- Regex Match()
|
|
||||||
# beware, stupid python interprets backslashes in replace-parts only partially!
|
|
||||||
class MatchReplace:
|
|
||||||
""" A MatchReplace is a mix of a Python Pattern and a Replace-Template """
|
|
||||||
def __init__(self, matching, template, count = 0, flags = None):
|
|
||||||
""" setup a substition from regex 'matching' into 'template',
|
|
||||||
the replacement count default of 0 will replace all occurrences.
|
|
||||||
The first argument may be a Match object or it is a string that
|
|
||||||
will be turned into one by using Match(matching, flags). """
|
|
||||||
self.template = template
|
|
||||||
MatchReplace.__call__(self, matching, template, count, flags)
|
|
||||||
def __call__(self, matching, template = None, count = 0, flags = None):
|
|
||||||
""" other than __init__ the template may be left off to be unchanged"""
|
|
||||||
if isinstance(count, basestring): # count/flags swapped over?
|
|
||||||
flags = count; count = 0
|
|
||||||
if isinstance(matching, Match):
|
|
||||||
self.matching = matching
|
|
||||||
else:
|
|
||||||
self.matching = Match()(matching, flags) ## python 2.4.2 bug
|
|
||||||
if template is not None:
|
|
||||||
self.template = template
|
|
||||||
self.count = count
|
|
||||||
def __and__(self, string):
|
|
||||||
""" z = MatchReplace('foo', 'bar') & 'foo'; assert z = 'bar' """
|
|
||||||
text, self.matching.replaced = \
|
|
||||||
self.matching.regex.subn(self.template, string, self.count)
|
|
||||||
return text
|
|
||||||
def __rand__(self, string):
|
|
||||||
""" z = 'foo' & Match('foo') >> 'bar'; assert z = 'bar' """
|
|
||||||
text, self.matching.replaced = \
|
|
||||||
self.matching.regex.subn(self.template, string, self.count)
|
|
||||||
return text
|
|
||||||
def __iand__(self, string):
|
|
||||||
""" x = 'foo' ; x &= Match('foo') >> 'bar'; assert x == 'bar' """
|
|
||||||
string, self.matching.replaced = \
|
|
||||||
self.matching.regex.subn(self.template, string, self.count)
|
|
||||||
return string
|
|
||||||
def __rshift__(self, count):
|
|
||||||
" shorthand to set the replacement count: Match('foo') >> 'bar' >> 1 "
|
|
||||||
self.count = count ; return self
|
|
||||||
def __rlshift__(self, count):
|
|
||||||
self.count = count ; return self
|
|
||||||
|
|
||||||
class Match:
|
|
||||||
""" A Match is actually a mix of a Python Pattern and MatchObject """
|
|
||||||
def __init__(self, pattern = None, flags = None):
|
|
||||||
""" flags is a string: 'i' for case-insensitive etc.; it is just
|
|
||||||
short for a regex prefix: Match('foo','i') == Match('(?i)foo') """
|
|
||||||
Match.__call__(self, pattern, flags)
|
|
||||||
def __call__(self, pattern, flags = None):
|
|
||||||
assert isinstance(pattern, str) or pattern is None
|
|
||||||
assert isinstance(flags, str) or flags is None
|
|
||||||
self.replaced = 0 # set by subn() inside MatchReplace
|
|
||||||
self.found = None # set by search() to a MatchObject
|
|
||||||
self.pattern = pattern
|
|
||||||
if pattern is not None:
|
|
||||||
if flags:
|
|
||||||
self.regex = re.compile("(?"+flags+")"+self.pattern)
|
|
||||||
else:
|
|
||||||
self.regex = re.compile(self.pattern)
|
|
||||||
return self
|
|
||||||
def __repr__(self):
|
|
||||||
return self.pattern
|
|
||||||
def __truth__(self):
|
|
||||||
return self.found is not None
|
|
||||||
def __and__(self, string):
|
|
||||||
self.found = self.regex.search(string)
|
|
||||||
return self.__truth__()
|
|
||||||
def __rand__(self, string):
|
|
||||||
self.found = self.regex.search(string)
|
|
||||||
return self.__truth__()
|
|
||||||
def __rshift__(self, template):
|
|
||||||
return MatchReplace(self, template)
|
|
||||||
def __rlshift__(self, template):
|
|
||||||
return MatchReplace(self, template)
|
|
||||||
def __getitem__(self, index):
|
|
||||||
return self.group(index)
|
|
||||||
def group(self, index):
|
|
||||||
assert self.found is not None
|
|
||||||
return self.found.group(index)
|
|
||||||
def finditer(self, string):
|
|
||||||
return self.regex.finditer(string)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# matching:
|
|
||||||
if "foo" & Match("oo"):
|
|
||||||
print("oo")
|
|
||||||
x = Match()
|
|
||||||
if "foo" & x("(o+)"):
|
|
||||||
print(x[1])
|
|
||||||
# replacing:
|
|
||||||
y = "fooboo" & Match("oo") >> "ee"
|
|
||||||
print(y)
|
|
||||||
r = Match("oo") >> "ee"
|
|
||||||
print("fooboo" & r)
|
|
||||||
s = MatchReplace("oo", "ee")
|
|
||||||
print("fooboo" & s)
|
|
@ -1,29 +0,0 @@
|
|||||||
--- ./a/zzip/_config.h 2021-07-21 14:18:09.000000000 +0200
|
|
||||||
+++ ./b/zzip/_config.h 2021-07-21 14:46:24.037432969 +0200
|
|
||||||
@@ -138,9 +138,12 @@
|
|
||||||
|
|
||||||
/* whether the system defaults to 32bit off_t but can do 64bit when requested
|
|
||||||
*/
|
|
||||||
+#if __WORDSIZE == 32
|
|
||||||
#ifndef ZZIP_LARGEFILE_SENSITIVE
|
|
||||||
#define ZZIP_LARGEFILE_SENSITIVE 1
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
+/* #undef LARGEFILE_SENSITIVE */
|
|
||||||
|
|
||||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
|
||||||
#ifndef ZZIP_LT_OBJDIR
|
|
||||||
@@ -227,9 +230,13 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
|
||||||
+#if __WORDSIZE == 32
|
|
||||||
#ifndef ZZIP__FILE_OFFSET_BITS
|
|
||||||
#define ZZIP__FILE_OFFSET_BITS 64
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
+/* #undef _FILE_OFFSET_BITS */
|
|
||||||
+
|
|
||||||
|
|
||||||
/* Define for large files, on AIX-style hosts. */
|
|
||||||
/* #undef _LARGE_FILES */
|
|
@ -1,29 +0,0 @@
|
|||||||
--- ./a/zzip/_config.h 2021-07-21 14:18:14.000000000 +0200
|
|
||||||
+++ ./b/zzip/_config.h 2021-07-21 14:46:24.037432969 +0200
|
|
||||||
@@ -138,6 +138,11 @@
|
|
||||||
|
|
||||||
/* whether the system defaults to 32bit off_t but can do 64bit when requested
|
|
||||||
*/
|
|
||||||
+#if __WORDSIZE == 32
|
|
||||||
+#ifndef ZZIP_LARGEFILE_SENSITIVE
|
|
||||||
+#define ZZIP_LARGEFILE_SENSITIVE 1
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
/* #undef LARGEFILE_SENSITIVE */
|
|
||||||
|
|
||||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
|
||||||
@@ -225,8 +230,14 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
|
||||||
+#if __WORDSIZE == 32
|
|
||||||
+#ifndef ZZIP__FILE_OFFSET_BITS
|
|
||||||
+#define ZZIP__FILE_OFFSET_BITS 64
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
/* #undef _FILE_OFFSET_BITS */
|
|
||||||
|
|
||||||
+
|
|
||||||
/* Define for large files, on AIX-style hosts. */
|
|
||||||
/* #undef _LARGE_FILES */
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
#! /usr/bin/env python3
|
|
||||||
|
|
||||||
from zzipdoc.match import Match
|
|
||||||
|
|
||||||
# use as o.optionname to check for commandline options.
|
|
||||||
class Options:
|
|
||||||
var = {}
|
|
||||||
def __getattr__(self, name):
|
|
||||||
if not name in self.var: return None
|
|
||||||
return self.var[name]
|
|
||||||
def __setattr__(self, name, value):
|
|
||||||
self.var[name] = value
|
|
||||||
def scan(self, optionstring): # option-name or None
|
|
||||||
x = Match()
|
|
||||||
if optionstring & x(r"^--?(\w+)=(.*)"):
|
|
||||||
self.var[x[1]] = x[2] ; return x[1]
|
|
||||||
if optionstring & x(r"^--?no-(\w+)$"):
|
|
||||||
self.var[x[1]] = "" ; return x[1]
|
|
||||||
if optionstring & x(r"^--?(\w+)$"):
|
|
||||||
self.var[x[1]] = "*"; return x[1]
|
|
||||||
return None
|
|
||||||
#end Options
|
|
||||||
|
|
||||||
if False:
|
|
||||||
o = Options()
|
|
||||||
o.help = """
|
|
||||||
scans for options
|
|
||||||
"""
|
|
Loading…
Reference in new issue