TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Argument Parser for Swift

17 点作者 AJRF大约 5 年前

2 条评论

frou_dh大约 5 年前
Specifying the interface of a CLI command is a good example of a natural place for declarative programming. You just want to write WHAT the interface is, not HOW to do the parsing.<p>When I made a homegrown Lisp implementation, eventually being able to put a single macro &quot;(usage ...)&quot; in the standard library that, when utilised in a script, would invisibly generate the parsing and variable binding machinery, was one of the more rewarding parts.
makecheck大约 5 年前
This has a pretty minimal amount of code compared to many alternatives I’ve seen.<p>One minor nitpick; the default help output is a bit unlike most tools. For example, I’ve never seen a tool that says “OVERVIEW:”, they simply lead with a summary line; and, all-caps “USAGE:” doesn’t read as nicely to me as “Usage:” that almost any other command-line tool would print. (For some reason caps are common in man pages but not screen dumps.)