Skip to content

Commit cedd314

Browse files
committed
Add flag --version
1 parent d004196 commit cedd314

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#define __VERSION "Honeypot SSH-Server v0.4\n"
2+
13
#define DEBUG 0 // Debug output to stdout
24
#define LOGGING 0 // Write log
35
#define SUPPORT_SQLITE 1 // Support sqlite 3

src/honeypot-ssh-server.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
/*-------------------------------------*/
66

77
// Функции libssh
8-
#include <libssh/libssh.h>
9-
108
#include <libssh/callbacks.h>
119
#include <libssh/server.h>
1210
// Стандартные библиотеки
@@ -80,6 +78,7 @@ static struct argp_option options[] = {
8078
{"debug", 'd', "(1 or 0)", 0, "Enable debug mode, default is 0 (disabled)", 0},
8179
{"logging", 'L', "(1 or 0)", 0, "Enable logging mode, default is 0 (disabled)", 0},
8280
{"sqlite", 's', "(1 or 0)", 0, "Disable sqlite write, default is 1 (enabled)", 0},
81+
{"version", 'v', 0, 0, "Show version", 0},
8382

8483
// Конец списка опций
8584
{0}
@@ -114,6 +113,10 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
114113
case 's':
115114
args->sqlite = atoi(arg);
116115
break;
116+
case 'v':
117+
fprintf(stdout, __VERSION);
118+
exit(EXIT_SUCCESS);
119+
break;
117120
case ARGP_KEY_END:
118121
break;
119122
default:

0 commit comments

Comments
 (0)