Livt packages

Eccelerators.Cli

Version 1.4.1

Transport-independent, bounded command-line input, parsing, editing, and output for Livt FPGA applications.

Published files (23)

tests/CommandProbe.lvt

namespace Eccelerators.Cli.Tests

using Eccelerators.Cli

/**
 * Test operation with observable invocations, including blocked attempts.
 */
component CommandProbe : ICommand
{
	cli: Cli
	public attempts: int

	new(cli: Cli)
	{
		this.cli = cli
	}

	override fn Matches() bool
	{
		return this.cli.CommandEquals("ping".Encode())
	}

	override fn TryExecute() bool
	{
		this.attempts++
		return this.cli.TryWriteLine("Pong".Encode())
	}
}