from subprocess import call

def init_parser(parser):
    parser.add_argument('name', type=str, help='Cluster name.')

def main(args):
    print("Stopping cluster '{}'...".format(args.name))

    call(['gcloud', 'dataproc', 'clusters', 'delete', '--quiet', args.name])

from subprocess import call

def init_parser(parser):
    parser.add_argument('name', type=str, help='Cluster name.')
    parser.add_argument('--async', action='store_true', help="Do not wait for cluster deletion.")

def main(args):
    print("Stopping cluster '{}'...".format(args.name))

    cmd = ['gcloud', 'dataproc', 'clusters', 'delete', '--quiet', args.name]
    if args.async:
        cmd.append('--async')

    call(cmd)

add async option to stop (#73)