public override IElement Action(ArgumentContainer Args) { var path = Args.GetVisitedArgumentAs <Str>("path"); if (localFiles.ContainsKey(path.Value)) { Directory.SetCurrentDirectory(localFiles[path.Value]); RescanFiles(); } return(new Noop()); }
public override IElement Action(ArgumentContainer Args) { var arg = Args.GetVisitedArgumentAs <Str>("in", true); if (arg == null) { return(new Time().Initialize(DateTime.UtcNow)); } if (DateTime.TryParse(arg.Value, out DateTime result)) { return(new Time().Initialize(result)); } throw new TypeException("Could not create Time from provided string."); }
public override IElement Action(ArgumentContainer Args) { var p = Args.GetVisitedArgumentAs <Str>("filename"); return(new Str().Initialize(File.ReadAllText(p.Value))); }