mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-07-02 14:04:22 +00:00
Show --builtin even when no actions are found.
This commit is contained in:
parent
c89d4b69d5
commit
5549e7c97d
2 changed files with 8 additions and 3 deletions
|
@ -42,6 +42,7 @@ void find_actions (char*** parOut, size_t* parCount) {
|
|||
list.count = 0;
|
||||
foreach_dir(&increase_actionlist, &list);
|
||||
if (0 == list.count) {
|
||||
*parOut = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -60,7 +61,9 @@ void free_actions (char** parActions, size_t parCount) {
|
|||
for (z = 0; z < parCount; ++z) {
|
||||
free(parActions[z]);
|
||||
}
|
||||
free(parActions);
|
||||
if (parActions) {
|
||||
free(parActions);
|
||||
}
|
||||
}
|
||||
|
||||
static void foreach_dir (void(*parAction)(const char*, ActionList*), ActionList* parList) {
|
||||
|
|
|
@ -40,9 +40,11 @@ int main (int parArgc, char* parArgv[]) {
|
|||
char** argv;
|
||||
FILE* streamout;
|
||||
int retval;
|
||||
int showbuiltin;
|
||||
|
||||
showbuiltin = (parArgc >= 2 ? not strcmp("--builtin", parArgv[1]) : 0);
|
||||
find_actions(&actions, &actions_count);
|
||||
if (0 == actions_count) {
|
||||
if (0 == actions_count and not showbuiltin) {
|
||||
fprintf(stderr, "No actions found in \"%s\"\n", ACTIONS_SEARCH_PATH);
|
||||
return 1;
|
||||
}
|
||||
|
@ -64,7 +66,7 @@ int main (int parArgc, char* parArgv[]) {
|
|||
free_actions(actions, actions_count);
|
||||
return retval;
|
||||
}
|
||||
else if (strcmp("--builtin", parArgv[1]) == 0) {
|
||||
else if (showbuiltin) {
|
||||
print_builtin_feats();
|
||||
free_actions(actions, actions_count);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue