#!/usr/bin/env python3

from __future__ import print_function

import sys
import argparse

import reflectrpc.cmdline
from reflectrpc.rpcsh import ReflectRpcShell

parser = reflectrpc.cmdline.build_cmdline_parser("Interactive shell to access JSON-RPC services (part of the ReflectRPC project)")

args = parser.parse_args()
client = reflectrpc.cmdline.connect_client(parser, args)

try:
    shell = ReflectRpcShell(client)

    shell.connect()
    shell.cmdloop()
except KeyboardInterrupt:
    sys.exit(0)
