#!/usr/bin/env python

from __future__ import print_function

import os
import sys
import webbrowser


DOCUMENTATION_URL = 'http://stsdas.stsci.edu/stsci_python_epydoc'


if __name__ == '__main__':
    for arg in sys.argv:
        if arg in ('-h', '--help'):
            print('Uses the default web browser to display the ' \
                  'stsci_python documentation')
            break

    try:
        webbrowser.open(DOCUMENTATION_URL, new=1)
    except:
        print('There was a problem display the documentation.')
        print('To view the documentation, direct your web browser to the ' \
              'following URL:\n')
        print('    ' + DOCUMENTATION_URL)
