def build_ssh_command(config):
    """
    Prepare an ssh command according to the arguments passed on command line

    :param argparse.Namespace config: the configuration from command line
    :return list[str]: the ssh command as list of string
    """
    ssh_command = ['ssh', '%s@%s' % (config.user, config.barman_host), 'barman'
        ]
    if config.config:
        ssh_command.append("--config='%s'" % config.config)
    ssh_command.extend(['put-wal', config.server_name])
    if config.test:
        ssh_command.append('--test')
    return ssh_command
