TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Argument Parser for Swift

17 pointsby AJRFabout 5 years ago

2 comments

frou_dhabout 5 years ago
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.
makecheckabout 5 years ago
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.)