Fix #5404 - r2agent -v show version

This commit is contained in:
pancake 2016-08-07 00:43:16 +01:00
parent 1447dc7522
commit d07b788786
2 changed files with 10 additions and 1 deletions

View File

@ -23,6 +23,11 @@ static int usage (int v) {
return !v;
}
static int showversion() {
printf (R2_VERSION"\n");
return 0;
}
int main(int argc, char **argv) {
RSocket *s;
RSocketHTTPRequest *rs;
@ -32,7 +37,7 @@ int main(int argc, char **argv) {
bool listenlocal = true;
const char *port = "8080";
while ((c = getopt (argc, argv, "ahp:ds")) != -1) {
while ((c = getopt (argc, argv, "adhp:sv")) != -1) {
switch (c) {
case 'a':
listenlocal = false;
@ -45,6 +50,8 @@ int main(int argc, char **argv) {
break;
case 'h':
return usage (1);
case 'v':
return showversion ();
case 'p':
port = optarg;
break;

View File

@ -20,6 +20,8 @@ Show help prompt
Run in sandbox mode
.It Fl p, Cm port Ar PORT
Specify listening port for the agent
.It Fl v
Show version information
.El
.Sh EXAMPLES
.Pp