Example #1
0
flux_t builtin_get_flux_handle (optparse_t *p)
{
    flux_t h = NULL;
    if ((h = optparse_get_data (p, "flux_t")))
        flux_incref (h);
    else if ((h = flux_open (NULL, 0)) == NULL)
        log_err_exit ("flux_open");
    return h;
}
Example #2
0
File: env.c Project: trws/flux-core
static int cmd_env (optparse_t *p, int ac, char *av[])
{
    int n = optparse_option_index (p);
    if (av && av[n]) {
        execvp (av[n], av+n); /* no return if sucessful */
        log_err_exit ("execvp (%s)", av[n]);
    } else {
        struct environment *env = optparse_get_data (p, "env");
        if (env == NULL)
            log_msg_exit ("flux-env: failed to get flux envirnoment!");
        print_environment (env);
    }
    return (0);
}
Example #3
0
static const char *default_cmdhelp_pattern (optparse_t *p)
{
    int *flags = optparse_get_data (p, "conf_flags");
    return flux_conf_get ("cmdhelp_pattern", *flags);
}