Skip to content

Extract program name without full path in icapp #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/icapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,10 @@ typedef struct len_t { unsigned id,cnt; uint64_t len; } len_t;
static int cmpsna(const void *a, const void *b) { return CMPSA(a, b, len_t, len); }

void usage(char *pgm) {
fprintf(stderr, "\nIcApp Copyright (c) 2013-2023 Powturbo %s\n", __DATE__);
for (char* p = pgm; *p; ++p) // extract program name without full path
if (*p == '\\' || *p == '/')
pgm = p + 1;
fprintf(stderr, "IcApp Copyright (c) 2013-2024 Powturbo, %s\n", __DATE__);
fprintf(stderr, "Usage: %s [options] [file]\n", pgm);
//fprintf(stderr, " -b#s # = blocksize (default filesize,). max=1GB\n");
fprintf(stderr, " -B#s # = max. benchmark filesize (default 1GB) ex. -B4G\n");
Expand Down