Skip to content

Commit

Permalink
Bring back switches "-V" and "--version". (#3384)
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode authored May 24, 2024
1 parent f727ba8 commit 0375089
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/janus.c
Original file line number Diff line number Diff line change
Expand Up @@ -4421,6 +4421,11 @@ gint main(int argc, char *argv[]) {
if(!janus_options_parse(&options, argc, argv))
exit(1);

if(options.print_version) {
janus_options_destroy();
exit(0);
}

/* Any configuration to open? */
if(options.config_file) {
config_file = g_strdup(options.config_file);
Expand Down
1 change: 1 addition & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ gboolean janus_options_parse(janus_options *options, int argc, char *argv[]) {
{ "token-auth-secret", 0, 0, G_OPTION_ARG_STRING, &options->token_auth_secret, "Secret to verify HMAC-signed tokens with, to be used with -A", "randomstring" },
{ "event-handlers", 'e', 0, G_OPTION_ARG_NONE, &options->event_handlers, "Enable event handlers", NULL },
{ "no-webrtc-encryption", 'w', 0, G_OPTION_ARG_NONE, &options->no_webrtc_encryption, "Disable WebRTC encryption, so no DTLS or SRTP (only for debugging!)", NULL },
{ "version", 'V', 0, G_OPTION_ARG_NONE, &options->print_version, "Print version and exit", NULL },
{ NULL, 0, 0, 0, NULL, NULL, NULL },
};

Expand Down
1 change: 1 addition & 0 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ typedef struct janus_options {
const char *token_auth_secret;
gboolean event_handlers;
gboolean no_webrtc_encryption;
gboolean print_version;
} janus_options;

/*! \brief Helper method to parse the command line options
Expand Down

0 comments on commit 0375089

Please sign in to comment.