Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom exporter options to be defined #1967

Open
PaulRitter opened this issue Mar 26, 2022 · 6 comments · May be fixed by #2461
Open

Allow custom exporter options to be defined #1967

PaulRitter opened this issue Mar 26, 2022 · 6 comments · May be fixed by #2461

Comments

@PaulRitter
Copy link

PaulRitter commented Mar 26, 2022

Currently options for the exporters console argument are hardcoded here:

private static readonly IReadOnlyDictionary<string, IExporter[]> AvailableExporters =
new Dictionary<string, IExporter[]>(StringComparer.InvariantCultureIgnoreCase)
{
{ "csv", new[] { CsvExporter.Default } },
{ "csvmeasurements", new[] { CsvMeasurementsExporter.Default } },
{ "html", new[] { HtmlExporter.Default } },
{ "markdown", new[] { MarkdownExporter.Default } },
{ "atlassian", new[] { MarkdownExporter.Atlassian } },
{ "stackoverflow", new[] { MarkdownExporter.StackOverflow } },
{ "github", new[] { MarkdownExporter.GitHub } },
{ "plain", new[] { PlainExporter.Default } },
{ "rplot", new[] { CsvMeasurementsExporter.Default, RPlotExporter.Default } }, // R Plots depends on having the full measurements available
{ "json", new[] { JsonExporter.Default } },
{ "briefjson", new[] { JsonExporter.Brief } },
{ "fulljson", new[] { JsonExporter.Full } },
{ "asciidoc", new[] { AsciiDocExporter.Default } },
{ "xml", new[] { XmlExporter.Default } },
{ "briefxml", new[] { XmlExporter.Brief } },
{ "fullxml", new[] { XmlExporter.Full } }
};

I would love a way to add custom exporters as options to this list.

@PaulRitter

This comment was marked as outdated.

@PaulRitter PaulRitter changed the title Allow custom exporters to be defined Allow custom exporter options to be defined Mar 26, 2022
@PaulRitter
Copy link
Author

actually, i will reopen this since it would be nice to be able to define exporter-options which are selectable over the args.

@PaulRitter PaulRitter reopened this Mar 26, 2022
@adamsitnik
Copy link
Member

i will reopen this since it would be nice to be able to define exporter-options which are selectable over the args.

@PaulRitter Could you please elaborate more on that? Please provide sample API design and code example.

@PaulRitter
Copy link
Author

i will reopen this since it would be nice to be able to define exporter-options which are selectable over the args.

@PaulRitter Could you please elaborate more on that? Please provide sample API design and code example.

I updated the original comment, did that clear it up? Otherwise im open to thinking a bit more on the idea and coming up with an entire API proposal, but i'd have to get more familiar with the project for that.

@adamsitnik
Copy link
Member

@PaulRitter now I get it: you would like to have the possibility to extend the existing command line argument parsing logic with the possibility to specify user-defined exporters so you can do sth like --exporter myExporter.

We could introduce a new method:

public static class ConfigParser
{
   public static void RegisterCustomExporter(string commandLineName, IExporter exporter) => AvailableExporters.Add(commandLineName, exporter);
}

@PaulRitter if that is what you need please send a PR.

@nazulg
Copy link
Contributor

nazulg commented Nov 6, 2023

Hi!

I would like to take this issue, I submitted a proposal in a PR.

The idea is for the user to create an exporter implementing IExporter and then add it from a command line argument .

Please let me know what you think, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants