Add the -V option to print the version number.

This commit is contained in:
Ivan Enderlin 2013-12-18 15:12:28 +01:00
parent 7e0d1938f9
commit abf68be7a4
2 changed files with 14 additions and 0 deletions

View file

@ -566,6 +566,7 @@ const opt_struct OPTIONS[] = { /* {{{ */
{'l', 1, "listen"}, {'l', 1, "listen"},
{'a', 1, "address-or-any"}, {'a', 1, "address-or-any"},
#endif #endif
{'V', 0, "version"},
{'-', 0, NULL} {'-', 0, NULL}
}; /* }}} */ }; /* }}} */
@ -998,6 +999,18 @@ phpdbg_main:
} else address = strdup(php_optarg); } else address = strdup(php_optarg);
} break; } break;
#endif #endif
case 'V': {
printf(
"phpdbg %s (built: %s %s)\nCopyright (c) 2013 %s\nPHP %s, Copyright (c) 1997-2013 The PHP Group\n",
PHPDBG_VERSION,
__DATE__,
__TIME__,
PHPDBG_AUTHORS,
PHP_VERSION
);
return 0;
} break;
} }
} }

View file

@ -589,6 +589,7 @@ PHPDBG_HELP(options) /* {{{ */
phpdbg_writeln(" -l\t-l4000\t\t\tSetup remote console ports"); phpdbg_writeln(" -l\t-l4000\t\t\tSetup remote console ports");
phpdbg_writeln(" -a\t-a192.168.0.3\t\tSetup remote console bind address"); phpdbg_writeln(" -a\t-a192.168.0.3\t\tSetup remote console bind address");
#endif #endif
phpdbg_writeln(" -V\tN/A\t\t\tVersion number");
phpdbg_notice("Passing -rr will quit automatically after execution"); phpdbg_notice("Passing -rr will quit automatically after execution");
#ifndef _WIN32 #ifndef _WIN32
phpdbg_writeln("Remote Console Mode"); phpdbg_writeln("Remote Console Mode");