Destination

link-destination is where work goes, as one type, parsed once from the slots every command shares. A command flattens Slots into its arguments, asks for the Target, and never reads --on, --cloud, --place or --here itself.

The slots

A command takes at most one of three slots, and --here is the default where a command has one. Slots::target answers None when none is given, and Slots::target_or_here answers Target::Here then.

--on

--on <machine> is a machine by its real name: a box on any cloud, or a machine of the Local Cloud. It parses to Target::On. --on here and --on local are refused, because neither is a machine.

--cloud

--cloud <cloud> is a cloud account from lnk cloud list, such as aws, link or local. It parses to Target::Cloud, with its place when --place is given.

--place

--place <place> is a region or zone of the cloud, and only goes with --cloud. A cloud's own word for it is kept, so only its characters are checked. The Local Cloud has machines and no places, so --cloud local --place is refused.

--here

--here is this machine, directly, with no relay and no Local Cloud needed. It parses to Target::Here, and it is the default where a command has one.

Refusals

A refusal is a Refusal, and its message names the slot the value belongs in. Two slots give --on and --cloud both say where, and --place without --cloud says to give --cloud with it. A value of the wrong type is never guessed: --on here says to use --here, and --on local says it is a cloud, --cloud local.

Telling a machine from a cloud

A machine and a cloud account may share a name, so the slot says which one is meant. When a name is only a cloud, --on aws is refused with --cloud aws, and when it is only a machine, --cloud mac is refused with --on mac. Target::check makes this refusal, given the Known machines and clouds, which the command reads from its own sources. A name that is both is right in either slot.

The strict form

A Target displays as the command line spells it: --on mac, --cloud gcp --place europe-west4-b or --here. Help, errors and Nexts show this form first.