Exemple #1
0
def option_parser():
    parser = common_parser()
    parser.usage = "%prog [OPTIONS] -g group_name [ 'command [...]' ]"
    parser.usage += "\n       %prog [OPTIONS] -f host_file [ 'command [...]' ]"
    parser.usage += "\n       %prog [OPTIONS] host[1-2] 'command [...]'"
    #parser.epilog = "Example: pgm -b denalihost uptime"
    parser.epilog = None

    parser.add_option('-P', '--print', dest='print_out', action='store_true',
            help='print output as we get it (OPTIONAL)')
    parser.add_option('-i', '--inline', dest='inline', action='store_false', default=True, 
            help='inline aggregated output for each server (OPTIONAL)')

    return parser
Exemple #2
0
def option_parser():
    '''
    Create commandline option parser.
    '''
    parser = common_parser()
    parser.usage = "%prog [OPTIONS] command [...]"
    parser.epilog = "Example: pssh -h hosts.txt -l irb2 -o /tmp/foo uptime"

    parser.add_option('-i', '--inline', dest='inline', action='store_true',
                      help='inline aggregated output for each server')
    parser.add_option('-I', '--send-input', dest='send_input',
                      action='store_true',
                      help='read from standard input and send as input to ssh')
    parser.add_option('-P', '--print', dest='print_out', action='store_true',
                      help='print output as we get it')

    return parser
Exemple #3
0
def option_parser():
    parser = common_parser()
    parser.usage = "%prog [OPTIONS] command [...]"
    parser.epilog = "Example: pssh -h hosts.txt -l irb2 -o /tmp/foo uptime"

    parser.add_option('-i', '--inline', dest='inline', action='store_true',
            help='inline aggregated output and error for each server')
    parser.add_option('--inline-stdout', dest='inline_stdout',
            action='store_true',
            help='inline standard output for each server')
    parser.add_option('-I', '--send-input', dest='send_input',
            action='store_true',
            help='read from standard input and send as input to ssh')
    parser.add_option('-P', '--print', dest='print_out', action='store_true',
            help='print output as we get it')
    parser.add_option('--soft_kill', dest='soft_kill', action='store_true',
            help='write ctrl+c char (0x03) to processes instead of sending SIGKILL on termination')

    return parser