Native argument parsing
还没有人认领这个 Issue。
评估
调研方向
未指定源文件或测试。先阅读 docopt 风格的示例和提议的 lj docstring 调用,然后定义内置参数解析和 docstring 生成两者所需的语言与 CLI 行为。完成的标准是达成一项涵盖语法、生成的值、导入或配置以及命令行工作流的共识设计。
由索引模型根据 Issue 内容生成。
描述
Argument parsing is so common that it should be built into the language. For example Docopt Strings should be automatically recognized. This should not require imports or configuration in the code by the user. They should be responsible for the docstring and that is all. Remembering the syntax and symantics of docstring itself can also be tedious. LJ should provide a command line tool that aids in generating this string.
Examples
"""
Hello, world!
Usage:
hello_world <author>
hello_world -h | --help
hello_world --version
Options:
-h --help Show this screen.
--version Show version.
"""
main() {
printf("Hello, world!, from %s", author)
}
This example uses multi line comment syntax similar to docstrings in python. This is just for the purpose of the example. This example also demonstrates the author variable being in scope due to the docstring. This is also just for the purpose of the example. We may want to explore having an implicit arg map or similar.
$ lj docstring --name "Hello,world!" hello_world <author>
$ ... #print docstring shown in previous example
This cli would need to be easy enough to use that a user wouldn't need to google docopt everytime they need to do some argument parsing.
- 主要语言
- Java
- 星标
- 6
- 派生
- 7
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JMU-CS/less-java 的其他 Issue
-
cleanup help wanted
难度 1/5 1 小时以内 新手友好度 72/100
-
cleanup
难度 1/5 1 小时以内 新手友好度 45/100
-
cleanup enhancement
难度 5/5 一周以上 新手友好度 10/100
-
cleanup
难度 3/5 1-2 天 新手友好度 45/100
-
Add REPL 未关闭enhancement
难度 5/5 一周以上 新手友好度 15/100
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
apache/cloudstack#14222 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
1.0.0-alpha2 Type/Improvement
难度 2/5 1-3 小时 新手友好度 68/100
wso2/dpdp-accelerator#272 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
infinispan/infinispan#18150 ·
-
area/frontend
难度 2/5 1-3 小时 新手友好度 65/100