parent
dfbc91f22e
commit
156e281a82
|
@ -14,6 +14,8 @@ logger = logging.getLogger(__name__)
|
||||||
def take():
|
def take():
|
||||||
parser = argparse.ArgumentParser(description='update version records of nvchecker')
|
parser = argparse.ArgumentParser(description='update version records of nvchecker')
|
||||||
core.add_common_arguments(parser)
|
core.add_common_arguments(parser)
|
||||||
|
parser.add_argument('--all', action='store_true',
|
||||||
|
help='take all updates')
|
||||||
parser.add_argument('names', metavar='NAME', nargs='*',
|
parser.add_argument('names', metavar='NAME', nargs='*',
|
||||||
help='software name to be updated')
|
help='software name to be updated')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -30,6 +32,9 @@ def take():
|
||||||
oldvers = core.read_verfile(s.oldver)
|
oldvers = core.read_verfile(s.oldver)
|
||||||
newvers = core.read_verfile(s.newver)
|
newvers = core.read_verfile(s.newver)
|
||||||
|
|
||||||
|
if args.all:
|
||||||
|
oldvers.update(newvers)
|
||||||
|
else:
|
||||||
for name in args.names:
|
for name in args.names:
|
||||||
try:
|
try:
|
||||||
oldvers[name] = newvers[name]
|
oldvers[name] = newvers[name]
|
||||||
|
|
Loading…
Reference in New Issue