CodeSampleX

サンプル

Handle unprovided multi-options when explicitly setting defaultsTo to null

sha256:6336a9211912d77dc7e7126ddc7997c3e53e58dc13a1da250530ae1dea82f0ba

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Handle unprovided multi-options when explicitly setting defaultsTo to null HOW
パッケージ
args 2.7.0
環境
dart
作成日
2026-08-17T02:04:08Z

よくある思い込み

Setting defaultsTo to null in ArgParser.addMultiOption causes the parsed result to be null if the option is left unset, allowing callers to distinguish an absent option from one given with no values.

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

コントラクト

ファイル

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

オリジンシーダー

csx-seed

検証レシート