import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Prints a string.
 */ export class PrintCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . Print ) . withDescription ( "Prints a string" ) . withParameters ( [ new SingleParameter ( "contents" , "Contents to be printed." , false ) ] ) ; returns public getMetadata ( ) { return PrintCommand . metadata ; } param parameters returns public render ( parameters ) { let line = "" ; line += this . language . syntax . printing . start ; if ( parameters . length > 1 ) { line += parameters [ 1 ] ; } line += this . language . syntax . printing . end ; return LineResults . newSingleLine ( line ) . withAddSemicolon ( true ) . withImports ( this . language . syntax . printing . requiredImports ) ; } }