Skip to content
/ args Public

very simple C++ header only command line parser 命令行參數解析

License

Notifications You must be signed in to change notification settings

gwankyun/args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

args

命令行參數解析

header-only,需C++11

用法:

#include <args.hpp>

args_t args(argc, argv);

auto filename = get(args, 1, "--filename", "-f");
auto mode = get(args, 2, "--mode", "-m");

if (!filename.empty())
{
	cout << "filename:" << filename[0] << endl;
}

if (!mode.empty())
{
	cout << "mode:" << mode[0] << endl;
}

一行一個參數,支持位置項及命名項,命名項支持列表。

About

very simple C++ header only command line parser 命令行參數解析

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages