import { LineResults } from "../LineResults" ; import { Command } from "./Command" ; import { CommandNames } from "../Names/CommandNames" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Returns a value.
 */ export class ReturnCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . Return ) . withDescription ( "Returns a value" ) . withParameters ( [ new SingleParameter ( "value" , "A value to return." , false ) ] ) ; returns public getMetadata ( ) { return ReturnCommand . metadata ; } param parameters returns public render ( parameters ) { let output = "return" ; if ( parameters . length > 1 ) { output += " " + parameters [ 1 ] ; } return LineResults . newSingleLine ( output ) . withAddSemicolon ( true ) ; } }