Skip to content

merge multiple *fetch version functions into one #10

Description

@koibtw

these functions:

fetchfetch/stats.c

Lines 82 to 92 in f684db4

char* fastfetch() {
// NOTE Version in the format "fastfetch x.x.x (ARCH)"
char *out = app_version("fastfetch --version");
return extract_named_version(out, "fastfetch ");
}
char* neofetch() {
// NOTE Version in the format "Neofetch x.x.x"
char *out = app_version("neofetch --version");
return extract_named_version(out, "Neofetch ");
}

could be merged into one. like this:

FetchStat* get_stats() {
	FetchStat *stats = malloc(STATS_SIZE * sizeof(FetchStat));
	stats[0].label = "Fastfetch";
	stats[0].version = get_version(/* command */ "fastfetch --version", /* prefix */ "fastfetch ");
	return stats;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions