Native argument parsing

未关闭
#63 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
java
领域
cli, compilers

调研方向

未指定源文件或测试。先阅读 docopt 风格的示例和提议的 lj docstring 调用,然后定义内置参数解析和 docstring 生成两者所需的语言与 CLI 行为。完成的标准是达成一项涵盖语法、生成的值、导入或配置以及命令行工作流的共识设计。

由索引模型根据 Issue 内容生成。

描述

enhancement proposal

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JMU-CS/less-java 的其他 Issue

查看 JMU-CS/less-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。