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 AntShell.Commands; 10 using Antmicro.Renode.UserInterface.Tokenizer; 11 12 namespace Antmicro.Renode.UserInterface.Commands 13 { 14 public class VerboseCommand : Command 15 { PrintHelp(ICommandInteraction writer)16 public override void PrintHelp(ICommandInteraction writer) 17 { 18 base.PrintHelp(writer); 19 writer.WriteLine("Current value: " + verbose); 20 } 21 22 [Runnable] SetVerbosity(ICommandInteraction writer, BooleanToken verbosity)23 public void SetVerbosity(ICommandInteraction writer, BooleanToken verbosity) 24 { 25 verbose = verbosity.Value; 26 setVerbosity(verbose); 27 } 28 VerboseCommand(Monitor monitor, Action<bool> setVerbosity)29 public VerboseCommand(Monitor monitor, Action<bool> setVerbosity) : base(monitor, "verboseMode", "controls the verbosity of the Monitor.") 30 { 31 verbose = false; 32 this.setVerbosity = setVerbosity; 33 } 34 35 private readonly Action<bool> setVerbosity; 36 private bool verbose; 37 } 38 } 39 40