Manipulate one or more Junos devices.

    Purpose: The main function is the entry point for the jaide tool. Click
           | handles arguments, commands and options. The parameters passed to
           | this function are all potential options (required or not) that
           | must come *before* the command from the group in the command line.

    @param ctx: The click context paramter, for receiving the object dictionary
              | being manipulated by other previous functions. Needed by any
              | function with the @click.pass_context decorator.
    @type ctx: click.Context
    @param host: The IP(s) or hostname(s) of the devices to connect to.
    @type host: str
    @param password: The string password used to connect to the device.
    @type password: str
    @param port: The numerical port to establish the connection to. Defauls
               | to 22.
    @type port: int
    @param quiet: An option that the user can set to suppress all output
                | from jaide.
    @type quiet: bool
    @param session_timeout: Sets the session timeout value. A higher value may
                          | be desired for long running commands, such as
                          | 'request system snapshot slice alternate'
    @type session_timeout: int
    @param connect_timeout: Sets the connection timeout value. This is how
                          | we'll wait when connecting before classifying
                          | the device unreachable.
    @type connect_timeout: int
    @param username: The string username used to connect to the device.
    @type useranme: str

    @returns: None. Functions part of click relating to the command group
            | 'main' do not return anything. Click handles passing context
            | between the functions and maintaing command order and chaining.

def main(ctx, host, password, port, quiet, session_timeout, connect_timeout,
         username):
    """ Manipulate one or more Junos devices.

    Purpose: The main function is the entry point for the jaide tool. Click
           | handles arguments, commands and options. The parameters passed to
           | this function are all potential options (required or not) that
           | must come *before* the command from the group in the command line.

    @param ctx: The click context paramter, for receiving the object dictionary
              | being manipulated by other previous functions. Needed by any
              | function with the @click.pass_context decorator.
    @type ctx: click.Context
    @param host: The IP(s) or hostname(s) of the devices to connect to.
    @type host: str
    @param password: The string password used to connect to the device.
    @type password: str
    @param port: The numerical port to establish the connection to. Defauls
               | to 22.
    @type port: int
    @param quiet: An option that the user can set to suppress all output
                | from jaide.
    @type quiet: bool
    @param session_timeout: Sets the session timeout value. A higher value may
                          | be desired for long running commands, such as
                          | 'request system snapshot slice alternate'
    @type session_timeout: int
    @param connect_timeout: Sets the connection timeout value. This is how
                          | we'll wait when connecting before classifying
                          | the device unreachable.
    @type connect_timeout: int
    @param username: The string username used to connect to the device.
    @type useranme: str

    @returns: None. Functions part of click relating to the command group
            | 'main' do not return anything. Click handles passing context
            | between the functions and maintaing command order and chaining.
    """
    # build the list of hosts
    ctx.obj['hosts'] = [ip for ip in clean_lines(host)]
    # set the connection parameters
    ctx.obj['conn'] = {
        "username": username,
        "password": password,
        "port": port,
        "session_timeout": session_timeout,
        "connect_timeout": connect_timeout
    }
    if quiet:
        ctx.obj['out'] = "quiet"