summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 94fed74..1cc20a4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -17,6 +17,7 @@
* along with opkg-opk. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
#include "opk.h"
@@ -30,6 +31,8 @@
#include <unistd.h>
#endif
+extern const char *PACKAGE_VERSION_GIT;
+
const char *_optstring = "I:fchV";
#ifdef HAVE_GETOPT_LONG
struct option _longopts[] = {
@@ -66,6 +69,20 @@ struct option _longopts[] = {
};
#endif
+static void
+_version(void)
+{
+ printf("%s %s%s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_VERSION_GIT);
+ printf("Copyright (C) %s %s\n", "2023", "Patrick McDermott");
+ puts("License GPLv3+: GNU GPL version 3 or later "
+ "<http://gnu.org/licenses/gpl.html>.\n"
+ "This is free software: you are free to change and "
+ "redistribute it.\n"
+ "There is NO WARRANTY, to the extent permitted by "
+ "law.\n");
+ printf("Please report bugs to <%s>.\n", PACKAGE_BUGREPORT);
+}
+
int
main(int argc, char *argv[])
{
@@ -104,8 +121,8 @@ main(int argc, char *argv[])
/* TODO */
break;
case 'V':
- /* TODO */
- break;
+ _version();
+ return EXIT_SUCCESS;
default:
/* TODO */
break;