summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-10-07 22:10:47 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-10-07 22:10:47 +0200
commit83414d8ff61f2e367dac4f571b7a03a035e83fa2 (patch)
tree5ea75ea1d20414bc1fff79f23d7654f4934a53c5 /main.c
parent62d3685a27463c45c36ece8f16a26f3d380a89ae (diff)
downloadttdaw-83414d8ff61f2e367dac4f571b7a03a035e83fa2.tar.gz
Added help and version options
Diffstat (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/main.c b/main.c
index 4fc3d1a..c196cdd 100644
--- a/main.c
+++ b/main.c
@@ -3,11 +3,14 @@
#include <stdarg.h>
#include <getopt.h>
+#include "version.h"
+
void help(const char *argv0) {
printf("Usage: %s [options]\n"
"\nAvailable options:\n"
" -h,--help this help\n"
" -v,--version show version\n"
+ " -l,--list list available devices\n"
" -p,--port=client:port device port\n",
argv0);
}
@@ -15,11 +18,11 @@ void help(const char *argv0) {
int main(int argc, char *argv[]) {
const char short_options[] = "hvlp";
const struct option long_options[] = {
- {"help", 0, NULL, 'h'},
- {"version", 0, NULL, 'v'},
- {"list", 0, NULL, 'l'},
- {"port", 1, NULL, 'p'},
- {0},
+ { "help", 0, NULL, 'h' },
+ { "version", 0, NULL, 'v' },
+ { "list", 0, NULL, 'l' },
+ { "port", 1, NULL, 'p' },
+ { 0 },
};
int c;
@@ -29,13 +32,17 @@ int main(int argc, char *argv[]) {
help(argv[0]);
return 0;
case 'v':
- fprintf(stdout, "Version\n");
+ fprintf(stdout, "ttdaw version %s\n", TTDAW_VERSION);
+ fprintf(stdout, "Website: %s.\n", TTDAW_WEBSITE);
+ fprintf(stdout, "%s\n", TTDAW_LICENSE);
+ fprintf(stdout, "%s\n", TTDAW_WARRANTY);
+ fprintf(stdout, "\n%s\n", TTDAW_AUTHOR);
return 0;
case 'l':
- fprintf(stdout, "List\n");
+ fprintf(stderr, "List feature is NOT implemented yet.\n");
return 0;
case 'p':
- fprintf(stdout, "Port\n");
+ fprintf(stderr, "Port feature is NOT implemented yet.\n");
return 0;
default:
fprintf(stdout, "No option provided\n");