1 // 2 // Copyright (c) 2010-2018 Antmicro 3 // Copyright (c) 2011-2015 Realtime Embedded 4 // 5 // This file is licensed under the MIT License. 6 // Full license text is available in 'licenses/MIT.txt'. 7 // 8 using System; 9 using Antmicro.Renode.UserInterface.Commands; 10 using Antmicro.Renode.UserInterface; 11 using AntShell.Commands; 12 using Antmicro.Renode.UserInterface.Tokenizer; 13 14 namespace Antmicro.Renode.Plugins.SampleCommandPlugin 15 { 16 public sealed class HelloCommand : Command 17 { PrintHelp(ICommandInteraction writer)18 public override void PrintHelp(ICommandInteraction writer) 19 { 20 base.PrintHelp(writer); 21 writer.WriteLine(); 22 writer.WriteLine("Usage:"); 23 writer.WriteLine(String.Format("{0} \"name\"", Name)); 24 } 25 26 [Runnable] Run(ICommandInteraction writer, StringToken name)27 public void Run(ICommandInteraction writer, StringToken name) 28 { 29 writer.WriteLine(String.Format("Hello, {0}!", name.Value)); 30 } 31 HelloCommand(Monitor monitor)32 public HelloCommand(Monitor monitor) : base(monitor, "hello", "Greets a user.") 33 { 34 } 35 } 36 } 37