parser = OptionParser(usage="sfi [sfi_options] %s [options] %s" \
% (command, cmdargs[command]))
+
+ # This option is for all commands
+ parser.add_option("-x", "--dumpformat", dest="dumpformat", type="choice",
+ help="dump format (text|xml)",default="text",
+ choices=("text","xml"))
+
if command in ("resources"):
parser.add_option("-f", "--format", dest="format",type="choice",
help="display format (dns|ip|rspec)",default="rspec",
record = AuthorityRecord(dict = record)
else:
record = GeniRecord(dict = record)
- record.dump()
+
+ if (opts.dumpformat=="text"):
+ record.dump()
+ else:
+ print record.save_to_string()
if opts.file:
save_records_to_file(opts.file, records)