On this page
Ada.Command_Line
Native process argument values.
Read the family guide for representation, selection and resource rules. The complete declaration page retains exact signatures/contracts; the source specification is the implementation baseline.
Availability and ownership
Argument requires a position from 1 to Argument_Count. The arguments are those of the command that starts an executable built with veradic build; under veradic run, Argument_Count is zero. Each result is a copy.
A client proof uses these contracts without proving the body again (see library assurance). Global => null excludes package-global effects, not changes made through an in out argument.
Import and instantiate
with Ada.Command_Line;import Ada.Command_Line;
A Vibe module imports this unit's names with from Ada.Command_Line import Name; see library use across syntaxes. In Varc, keep each name's declared spelling and write & on arguments the call changes.
Contract and lifecycle reading
A Pre condition is the caller's obligation; a Post is what a normal return guarantees. What a postcondition does not state, a client cannot assume. Ghost functions are for contracts and ghost code. The family guide describes copying, lifetime, order and cost.
API 001
Argument_Count (declaration) — The number of arguments, not counting the command name; zero under veradic run.
API 002
Argument (declaration) — Return a present positive application argument; its number must not exceed Argument_Count.
Before this operation, establish:
Number <= Argument_CountAPI 003
Command_Name (declaration) — Return the native command name from argument zero, or the current execution path's available empty value.