OpenXRay/xray-16

Sparse command line argument parsing with virtually no documentation on arguments

开放

#316 创建于 2019年1月2日

 (4 条评论) (0 个反应) (0 位负责人)C++ (519 个派生)auto 404
CoreDocumentationEnhancementHelp wanted

仓库指标

星标
 (3,524 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

The engine has many commandline arguments, but they all are parsed "in place" by using strstr.

Can we create a single struct with all the flags and params pre-parsed?

This may require additional dependency or even code generation tool to make it work efficiently, but will give us well documented cmd arguments and will concentrate all the parsing in one place, will make code more clear.

Pros:

  • no arguments-related strstr calls in code -> clear code and no ambiguity (i. e. when you have something like this: ./xr_3da -fsltx ../blablabla-globus/fsgame.ltx this will trigger -gl option on windows which may cause unwanted behavior)
  • documentation for arguments and --help option can be easily implemented
  • this may be efective in some usecases of strstr-based parsing

Cons:

  • This will require many lines of dull copy-paste code which we'll have to support
  • or to add another dependency (which also will not be as efficient as just a struct with fields)
  • or to use code-generation tool (which may bring more problems)

贡献者指南