Ejemplo
Ensure option-like arguments and the double-dash separator after a positional argument are treated as literal positional arguments when allowTrailingOptions is disabled
sha256:a8903858356386356972e088af4cc88ca064369aeb6c21d7e9db1fade9205dad
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Ensure option-like arguments and the double-dash separator after a positional argument are treated as literal positional arguments when allowTrailingOptions is disabled HOW
- Paquetes
- args 2.7.0
- Entorno
- dart
- Creado
- 2026-08-17T02:02:58Z
Lo que suele suponerse
When allowTrailingOptions is false, option-like arguments after the first positional argument still trigger validation, and the double-dash separator is consumed as a special token.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- Disabling allowTrailingOptions causes option-like arguments and the double-dash separator after a positional argument to be treated as literal positional arguments in results.rest rather than being parsed or consumed.
- assert parser with allowTrailingOptions: false treats --mode and --verbose after a positional argument as literal positional arguments in rest rather than parsing them
- assert parser with allowTrailingOptions: false preserves the double-dash separator in rest rather than consuming it
- assert default parser with allowTrailingOptions: true consumes the double-dash separator and parses options normally
Archivos
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- dart 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-16 · ed25519:d91480838ac982c9