def start():
    try:
        command = sys.argv[1]
    except IndexError:
        command = 'help'
    if '--help' in sys.argv:
        command = 'help'
    args = sys.argv[2:]

    instance = SftpCli()
    callback = getattr(instance, "command_%s" % command, None)
    if isinstance(callback, collections.Callable):
        try:
            callback(*args)
        except __HOLE__ as e:
            sys.stderr.write('Bad call for %s: %s' % (command, str(e)))
    else:
        instance.command_help()
dataset/ETHPy150Open spantaleev/sftpman/sftpman/cli.py/start