CAnthonyScott.io
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
洪 民憙 (Hong Minhee)@lemmy.ml to General Programming Discussion@lemmy.mlEnglish · 1 month ago

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

hackers.pub

external-link
message-square
0
link
fedilink
1
external-link

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

hackers.pub

洪 民憙 (Hong Minhee)@lemmy.ml to General Programming Discussion@lemmy.mlEnglish · 1 month ago
message-square
0
link
fedilink
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.
alert-triangle
You must log in or # to comment.

General Programming Discussion@lemmy.ml

programming@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]

Systems

  • [email protected]
  • [email protected]
  • [email protected]

Functional Programming

  • [email protected]
  • [email protected]

Also related

  • [email protected]
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 27 users / day
  • 34 users / week
  • 34 users / month
  • 34 users / 6 months
  • 1 local subscriber
  • 9.78K subscribers
  • 52 Posts
  • 7 Comments
  • Modlog
  • mods:
  • Evan@lemmy.ml
  • Restioson@lemmy.ml
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org