aboutsummaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorJan Sucan <jan@jansucan.com>2021-05-30 12:02:35 +0200
committerJan Sucan <jan@jansucan.com>2021-05-30 12:02:35 +0200
commit34fd60da22dae7711eb28f695c6b231a5ec83180 (patch)
tree30690676a5dcf79a957a215c238b128241cb4c6f /src/options.c
parentb2d000e697fc56c8c408432ed74a21f21d3e2423 (diff)
Move usage() function to options.c
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 019136b..a4dbcb9 100644
--- a/src/options.c
+++ b/src/options.c
@@ -7,6 +7,10 @@
#include "options.h"
#include "print.h"
+/* This header file is automatically generated at build time from the Makefile
+ */
+#include "program_info.h"
+
#define OPTIONS_DEFAULT_SECTOR_SIZE 512
#define OPTIONS_DEFAULT_BUFFER_SIZE (4 * 1024 * 1024)
@@ -94,6 +98,15 @@ options_parse(int argc, char **argv, options_t *const opts)
}
void
+options_usage(int exit_code)
+{
+ printf("Usage: %s [-s SECTOR_SIZE] [-b BUFFER_SIZE] [INFILE] REFFILE "
+ "OUTFILE\n",
+ PROGRAM_NAME_STR);
+ exit(exit_code);
+}
+
+void
options_init(options_t *const opts)
{
opts->help = false;