提交 97618c2b 编写于 作者: 指向BIOS的野指针's avatar 指向BIOS的野指针

update usage document

上级 e24bb569
#include "server.hh"
#define USEAGE \
"usage: bwl-server [options]" << std::endl \
<< "The options contains:" << std::endl \
<< "\t-h | --help\tTo print this document." << std::endl \
<< "\t-v | --version\tTo print version data." << std::endl \
<< "\t-c | --card\tTo choose which video card to use(card 0 as default)." << std::endl
#define USEAGE \
"usage: bwl-server [options] [args]" << std::endl \
<< "The options contains:" << std::endl \
<< "\t-h --help\tTo print this document." << std::endl \
<< "\t-v --version\tTo print version data." << std::endl \
<< "\t-c --card\tTo choose which video card to use(card 0 as default)." << std::endl
int main(int argc, char **argv)
{
......@@ -14,20 +14,21 @@ int main(int argc, char **argv)
//解析命令行参数
for (int i = 0; i < argc; i++)
{
if (std::string(argv[i]) == "-c" || std::string(argv[i]) == "--card")
std::string arg(argv[i]);
if (arg == "-c" || arg == "--card")
{
i++;
monitor_device = argv[i];
}
if (std::string(argv[i]) == "-v" || std::string(argv[i]) == "--version")
if (arg == "-v" || arg == "--version")
{
std::cout << "Bad WayLand " << BWL_VERSION << std::endl
<< "Bad Wayland Server " << BWLS_VERSION << std::endl;
exit(0);
}
if (std::string(argv[i]) == "-h" || std::string(argv[i]) == "--help")
if (arg == "-h" || arg == "--help")
{
std::cout << USEAGE;
exit(0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册