Skip to content

Commit

Permalink
feat: add startup log message
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Aug 7, 2024
1 parent bf08092 commit d0b136f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/syslog.h>

#include "cli.h"

#include "config.h"

void startup_message() {
syslog(LOG_INFO, "UA2F version: %s", UA2F_VERSION);
syslog(LOG_INFO, "Git commit: %s", UA2F_GIT_COMMIT);
syslog(LOG_INFO, "Git branch: %s", UA2F_GIT_BRANCH);
syslog(LOG_INFO, "Git tag: %s", UA2F_GIT_TAG);
}

// handle print --version and --help
void try_print_info(const int argc, char *argv[]) {
if (argc != 2) {
if (argc < 2) {
startup_message();
return;
}

Expand Down

0 comments on commit d0b136f

Please sign in to comment.