Skip to content

Commit

Permalink
Fixed #2691
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Dec 4, 2023
1 parent 284f891 commit cdc6d93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion applications/gpac/gpac.h
Expand Up @@ -69,7 +69,7 @@ void gpac_core_help(GF_SysArgMode mode, Bool for_logs);
void gpac_usage(GF_SysArgMode argmode);
void gpac_config_help(void);
void gpac_suggest_arg(char *aname);
void gpac_suggest_filter(char *fname, Bool is_help, Bool filter_only);
Bool gpac_suggest_filter(char *fname, Bool is_help, Bool filter_only);
void gpac_check_session_args(void);
int gpac_make_lang(char *filename);
Bool gpac_expand_alias(int o_argc, char **o_argv);
Expand Down
9 changes: 6 additions & 3 deletions applications/gpac/gpac_help.c
Expand Up @@ -1123,12 +1123,12 @@ void gpac_suggest_arg(char *aname)
}
}

void gpac_suggest_filter(char *fname, Bool is_help, Bool filter_only)
Bool gpac_suggest_filter(char *fname, Bool is_help, Bool filter_only)
{
Bool found = GF_FALSE;
Bool first = GF_FALSE;
u32 i, count, pass_exact = GF_TRUE;
if (!fname) return;
if (!fname) return GF_FALSE;

if (filter_only || !is_help) pass_exact = GF_FALSE;

Expand Down Expand Up @@ -1188,6 +1188,7 @@ void gpac_suggest_filter(char *fname, Bool is_help, Bool filter_only)
if (!doc) doc = "Not documented";
GF_LOG(GF_LOG_INFO, GF_LOG_APP, ("%s: %s\n", alias, doc));
found = GF_TRUE;
if (is_help) return GF_TRUE;
}
}
else if (gf_sys_word_match(fname, alias)) {
Expand Down Expand Up @@ -1294,6 +1295,7 @@ void gpac_suggest_filter(char *fname, Bool is_help, Bool filter_only)
is_help ? ", gpac -h or search all help using gpac -hx" : ""
));
}
return GF_FALSE;
}

static void gpac_suggest_filter_arg(GF_Config *opts, const char *argname, u32 atype)
Expand Down Expand Up @@ -2167,7 +2169,8 @@ Bool print_filters(int argc, char **argv, GF_SysArgMode argmode)

if (found) return GF_TRUE;

gpac_suggest_filter(fname, GF_TRUE, GF_FALSE);
if (gpac_suggest_filter(fname, GF_TRUE, GF_FALSE))
return GF_TRUE;
return GF_FALSE;
}

Expand Down

0 comments on commit cdc6d93

Please sign in to comment.