Browse Source

feat: `-h` and `--help` options

master
Dnomd343 2 years ago
parent
commit
bfa279d24e
  1. 18
      kms.php

18
kms.php

@ -29,6 +29,19 @@ $VLMCSD = array( // vlmcsd process
'pidFile' => '/run/vlmcsd.pid', 'pidFile' => '/run/vlmcsd.pid',
); );
$HELP_MSG = "
kms-server ($VERSION)
Project: https://github.com/dnomd343/kms-server.git
--debug Enable debug mode
--kms-port Specify kms listen port
--http-port Specify http listen port
--disable-http Disable http service
--version Show version info
--help Show help message
\n";
function load_nginx_config(int $kms_port, int $http_port): void { function load_nginx_config(int $kms_port, int $http_port): void {
global $VERSION; global $VERSION;
$nginx_config = "server { $nginx_config = "server {
@ -177,6 +190,11 @@ if (in_array('-v', $argv) || in_array('--version', $argv)) {
exit; exit;
} }
if (in_array('-h', $argv) || in_array('--help', $argv)) {
echo $HELP_MSG; // show help message
exit;
}
logging::info('Loading kms-server (' . $VERSION . ')'); logging::info('Loading kms-server (' . $VERSION . ')');
load_params(); load_params();
load_vlmcsd_command($KMS_PORT); load_vlmcsd_command($KMS_PORT);

Loading…
Cancel
Save