The structure and layout of the op script can make it difficult to follow, partly because SLAX op scripts are an XML pipeline, but we can focus on the cut and thrust of the logic that each step is trying to achieve.
In step 1, we define the standard boilerplate required for every SLAX op script on JUNOS. In step 2 we declare interface and mode special global parameters. This tells the CLI to expect the user to try to use these keywords for parameters. In the arguments node-set, we can actually include some tokens that will populate the CLI interactive help. Finally we take the interface and split it into two parts, separated by a period (.), because we'll likely need the interface components in this way as we explore the XML ...