Your CLI's completion should know what options you've already typed

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub

The latest update to Optique implements a sophisticated dependency system that enables command-line interface options to dynamically influence one another during parsing and shell completion. While standard parsers often treat flags in isolation, this framework allows for context-aware behavior similar to Git, where the value of one option determines the valid suggestions for another. By utilizing new primitives such as dependency and derive, developers can mark specific options as sources that inform the behavior of subsequent parsers through a three-phase execution strategy. This approach first collects dependency values and then applies them via factory functions to generate concrete, context-specific parsers at runtime. The system maintains full type safety while supporting both synchronous and asynchronous resolutions, which is essential for scenarios involving file system operations or remote API calls. Furthermore, it handles multiple dependencies seamlessly, ensuring complex relationships between parameters like environments and regions are validated correctly. This advancement empowers developers to create highly responsive and intuitive CLI tools that provide a superior user experience through intelligent, context-sensitive completion.

Read more →
5

❤️

5 people reacted.

Uncertified Quasi-pseudo dev

Japanese vivaldi lover. Poor web dev.
ichiji→Qiitadon→Misskey.dev→fedibird→vivaldi.social(now!)
自鯖も立ててみたけどうまくいかない日々...../My mastodon server never works correctly.....
デフォルト未収載人間/My toots are basically unlisted
Wannabe a better engineer in my next life

J→E translator (mainly business, sometimes games). Working on :nda:, and hoping to work on :nda:. Looking forward to the release of :nda: × 3.
Overeducated and unlearned. Fan of writing systems, shmups, nanoloop, lumines, puns, nonsense, and—last but not least—memories
he/him

日英翻訳者(主にビジネス文書。ゲームも)/文字マニア/ユダヤ人/文学バカせ/人間(堕落者)。身体の104%が文字と文字愛でできおり、残りの29%は肉体。STG・PZLとFM音源も好き。
前世は、漢字字体・仮名字体・仮名遣いをぼんやり眺めていました。論文を書いている内に、活字とIME(ATOK、MS-IME、ことえり、SKK)、ひいては文字処理システム全体(電子的・非電子的を含む)に対して嫌悪感と憧憬の念を強く抱くようになりました。

Functional programming, TypeScript, tooling.
 He/him. Views and opinions my own and do not reflect those of my employer.

I usually only follow folks with pronouns in bio.