CodeSampleX

サンプル

Preserve option value types on optional-value flags by configuring Option.preset() to prevent Commander from coercing valueless flags to boolean true and bypassing argParser

sha256:4bf9cbc16740182dbe7fcca88866b9e64c94372e4115587056c4b525005ba078

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Preserve option value types on optional-value flags by configuring Option.preset() to prevent Commander from coercing valueless flags to boolean true and bypassing argParser HOW
パッケージ
commander 15.0.0
環境
node
作成日
2026-08-17T01:48:40Z

よくある思い込み

An option configured with an optional value and a custom argParser coerces a fallback value through argParser when the flag is invoked without an argument on the command line.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート