Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.
This repository was archived by the owner on Aug 2, 2023. It is now read-only.

Support unknown options #825

Closed
Closed

Description

@patriksvensson

I would like to capture unknown options for a tool, that will be sent to another tool that takes arbitrary parameters used in a script. Is this possible somehow?

Example

This is what invocation could look like:

> mytool.exe --verbosity diagnostic --unknown value1 value2 --unknownflag --hello world

Where --unknown value1 value2 --unknownflag --hello world are parameters sent to the script.

And this is what I would want to do when parsing:

var result = ArgumentSyntax.Parse(args, syntax =>
{
    syntax.AllowUnknownOptions = true;
    syntax.DefineOption("v|verbosity", Verbosity.Normal, VerbosityParser.Parse);
});

IDictionary<string, IList<string>> unknown = result.GetUnknownOptions();

I understand that something like this might be out of scope for what you're building here, and I'm not even sure if the API that I've proposed makes any sense outside of my needs, but I thought I would ask.

If this is something that is of interest, I would be more than happy to provide a PR.

Activity

  1. bricelam commented on Oct 22, 2016

    @bricelam
    Contributor

    I want this too. Except it's probably enough just to retrieve them as IEnumerable<string>--the same way they went in.

  2. added a commit that references this issue on Nov 16, 2016
    96af17f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions