Skip to content

Commit

Permalink
add -o, --output option
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Jun 4, 2018
1 parent 6ba2403 commit 6e60ee6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pydoc_markdown/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def get_argument_parser(prog):
'account. Use ++ to include class members.')
parser.add_argument('--plain', action='store_true',
help='Generate a single Markdown file and write it to stdout.')
parser.add_argument('-o', '--output', type=argparse.FileType('w'), help=
'The output file for the --plain mode.')
parser.add_argument('--builddir', help='Override the build directory.')
parser.add_argument('--config', help='Override the configuration filename.')
parser.add_argument('--filter', help='Override the filter option. Must be '
Expand Down Expand Up @@ -173,7 +175,7 @@ def main(argv=None, prog=None, onreturn=None):
root.append(document)

if args.plain:
config.renderer.render_document(sys.stdout, document)
config.renderer.render_document(args.output or sys.stdout, document)
else:
for filename, document in index.documents.items():
filename = os.path.join(config.builddir, filename)
Expand Down

0 comments on commit 6e60ee6

Please sign in to comment.