using System;
using System.Xml;
using System.Xml.Serialization;

Console.Error.WriteLine($"probe: {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}; dynamic code supported {System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported}; dynamic code compiled {System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeCompiled}");
var job = new Job { Name = args.Length == 1 ? args[0] : "rebuild-index" };
#if BOUNDED_EXPORT
using var writer = XmlWriter.Create(Console.Out, new XmlWriterSettings { OmitXmlDeclaration = true });
writer.WriteStartElement("job");
writer.WriteElementString("name", job.Name);
writer.WriteEndElement();
#else
var serializer = new XmlSerializer(typeof(Job));
serializer.Serialize(Console.Out, job);
#endif

[XmlRoot("job")]
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public class Job
{
    [XmlElement("name")]
    public string Name { get; set; } = "";
}
