Fix #5404 - r2agent -v show version
This commit is contained in:
parent
1447dc7522
commit
d07b788786
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue