-s, --checksum = md5 or sha - select type of checksum to use (default: md5)
-h, --help = show this help
-V, --version = output version
-
+ -p, --pretty = output xml files in pretty format.
""") % os.path.basename(sys.argv[0])
cmds['baseurl'] = None
cmds['groupfile'] = None
cmds['sumtype'] = 'md5'
-
+ cmds['pretty'] = 0
try:
- gopts, argsleft = getopt.getopt(args, 'hqVvg:s:x:u:', ['help', 'exclude',
+ gopts, argsleft = getopt.getopt(args, 'phqVvg:s:x:u:', ['help', 'exclude',
'quiet', 'verbose',
'baseurl=', 'groupfile=',
- 'checksum=', 'version'])
+ 'checksum=', 'version',
+ 'pretty'])
except getopt.error, e:
errorprint(_('Options Error: %s.') % e)
usage()
elif arg in ['-x', '--exclude']:
cmds['excludes'].append(a)
+ elif arg in ['-p', '--pretty']:
+ cmds['pretty'] = 1
elif arg in ['-s', '--checksum']:
if a not in ['md5', 'sha']:
errorprint(_('Error: checksums are: md5 or sha.'))
errorprint(_('\nAn error occurred creating primary metadata: %s') % e)
continue
else:
- output = node.serialize(None, 1)
+ output = node.serialize(None, cmds['pretty'])
basefile.write(output)
basefile.write('\n')
node.unlinkNode()
errorprint(_('\nAn error occurred creating filelists: %s') % e)
continue
else:
- output = node.serialize(None, 1)
+ output = node.serialize(None, cmds['pretty'])
flfile.write(output)
flfile.write('\n')
node.unlinkNode()
errorprint(_('\nAn error occurred: %s') % e)
continue
else:
- output = node.serialize(None, 1)
+ output = node.serialize(None, cmds['pretty'])
otherfile.write(output)
otherfile.write('\n')
node.unlinkNode()