Parameters
Cheat sheet · https://pcornel.dk/topic.php?topic=5219
Answer
Parameters are the explicit caller-to-script contract for values that influence scope and behavior. Reliable parameters have defined type/shape, requiredness, defaults, allowed values and clear precedence.
Remember
- Parameter present ≠ parameter valid; syntax acceptance does not prove range, identity or target existence.
- Default value ≠ safe value for every environment; defaults must be context-appropriate and visible.
- Optional ≠ irrelevant; omitted parameters can materially alter scope through defaults or discovery.
- Parameter accepted ≠ caller authorized; authorization is a separate control from input parsing.
First checks
<script> --help— usagegetopts / argparse / param()— parameter parsing- Required parameter checks — validation
Verify in this order
CLI args → parser → validated parameters
Where it usually breaks
Successful parameter binding proves only that caller input was mapped into the script contract; it does not prove the value is safe, authorized or references a valid target.
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
Parameters scripting boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Input / runtime | Effective inputs, runtime, working context and dependency versions are explicit | Hidden defaults, stale environment, wrong interpreter/path or unvalidated input |
| Logic / execution | Branch/function/module decisions and external actions expose per-operation results | Swallowed failures, shell reinterpretation, blind retries or last-result-wins behavior |
| Result / proof | Exit/exception/log evidence is correlated with independent target read-back | Process success or printed output treated as target success |
| Recovery / troubleshooting | First failed boundary is preserved, changed minimally and retested | Random edits, catch-all suppression or evidence destroyed before diagnosis |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5219