added output option to index
This commit is contained in:
parent
9c3c37a727
commit
823de61ea8
@ -69,6 +69,7 @@ def main (args):
|
||||
p.add_argument("--content", default=False, action="store_true", help="rss: include (full) content tag, default: False")
|
||||
p.add_argument("--link", default="diffhtml,html,text", help="link variable will be to this version, can be comma-delim list, use first avail, default: diffhtml,html,text")
|
||||
p.add_argument("--linkbase", default=None, help="base url to use for links, default: try to use the feedurl")
|
||||
p.add_argument("--output", default=None, help="output, default: stdout")
|
||||
|
||||
pg = p.add_argument_group('template variables')
|
||||
pg.add_argument("--feedurl", default="feed.xml", help="rss: to use as feeds own (self) link, default: feed.xml")
|
||||
@ -169,4 +170,8 @@ def main (args):
|
||||
except KeyError as e:
|
||||
pass
|
||||
|
||||
print (template.render(vars(args)).encode("utf-8"))
|
||||
if args.output:
|
||||
with open(args.output, "w") as f:
|
||||
print (template.render(vars(args)).encode("utf-8"), file=f)
|
||||
else:
|
||||
print (template.render(vars(args)).encode("utf-8"))
|
||||
|
Loading…
Reference in New Issue
Block a user