Commit efc87fce authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

compel: cli -- Show own version with option

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8c39a000
...@@ -115,7 +115,7 @@ int main(int argc, char *argv[]) ...@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
}, },
}; };
static const char short_opts[] = "a:f:o:s:p:v:r:u:h"; static const char short_opts[] = "a:f:o:s:p:v:r:u:hV";
static struct option long_opts[] = { static struct option long_opts[] = {
{ "arch", required_argument, 0, 'a' }, { "arch", required_argument, 0, 'a' },
{ "file", required_argument, 0, 'f' }, { "file", required_argument, 0, 'f' },
...@@ -126,6 +126,7 @@ int main(int argc, char *argv[]) ...@@ -126,6 +126,7 @@ int main(int argc, char *argv[])
{ "variable", required_argument, 0, 'v' }, { "variable", required_argument, 0, 'v' },
{ "pcrelocs", required_argument, 0, 'r' }, { "pcrelocs", required_argument, 0, 'r' },
{ "help", required_argument, 0, 'h' }, { "help", required_argument, 0, 'h' },
{ "version", no_argument, 0, 'V' },
{ }, { },
}; };
...@@ -172,6 +173,13 @@ int main(int argc, char *argv[]) ...@@ -172,6 +173,13 @@ int main(int argc, char *argv[])
break; break;
case 'h': case 'h':
goto usage; goto usage;
case 'V':
printf("Version: %d.%d.%d\n",
COMPEL_SO_VERSION_MAJOR,
COMPEL_SO_VERSION_MINOR,
COMPEL_SO_VERSION_SUBLEVEL);
exit(0);
break;
default: default:
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment