comparison cutils/shasum.py @ 100:f95918115c6b

FIX: Implement some new commandline flags in "gen_opts()" also
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 29 Apr 2022 04:57:08 +0200
parents 59253a1e6ef2
children 08fd0609fdd4
comparison
equal deleted inserted replaced
99:e3962911a7bf 100:f95918115c6b
125 125
126 return shasum(opts) 126 return shasum(opts)
127 127
128 128
129 def gen_opts(files=[], algorithm="SHA1", bsd=False, text_mode=False, 129 def gen_opts(files=[], algorithm="SHA1", bsd=False, text_mode=False,
130 checklist=False, check=False, dest=None, base64=False): 130 checklist=False, check=False, dest=None, base64=False,
131 allow_distinfo=False, mmap=None):
131 if text_mode: 132 if text_mode:
132 raise ValueError("text mode not supported") 133 raise ValueError("text mode not supported")
133 if checklist and check: 134 if checklist and check:
134 raise ValueError("only one of `checklist' or `check' is allowed") 135 raise ValueError("only one of `checklist' or `check' is allowed")
135 opts = argparse.Namespace(files=files, 136 opts = argparse.Namespace(files=files,
138 bsd=bsd, 139 bsd=bsd,
139 checklist=checklist, 140 checklist=checklist,
140 check=check, 141 check=check,
141 text_mode=False, 142 text_mode=False,
142 dest=dest, 143 dest=dest,
143 base64=base64) 144 base64=base64,
145 allow_distinfo=allow_distinfo,
146 mmap=mmap)
144 return opts 147 return opts
145 148
146 149
147 def shasum(opts): 150 def shasum(opts):
148 if opts.check: 151 if opts.check: