mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 21:39:03 +02:00
util/spkmodem-recv: add a usage function
replace the err call in getopt Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -71,6 +71,7 @@ static void print_stats(struct decoder_state *st);
|
||||
static void reset_char(struct decoder_state *st);
|
||||
|
||||
static void err(int errval, const char *msg, ...);
|
||||
static void usage(void);
|
||||
static const char *progname(void);
|
||||
|
||||
int getopt(int, char * const *, const char *);
|
||||
@@ -110,7 +111,7 @@ main(int argc, char **argv)
|
||||
st.debug = 1;
|
||||
break;
|
||||
default:
|
||||
err(EINVAL, "Invalid argument");
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,6 +280,13 @@ err(int errval, const char *msg, ...)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-d]\n", progname());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static const char *
|
||||
progname(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user