Skip to content

Conversation

@kassemsandarusi
Copy link
Contributor

@kassemsandarusi kassemsandarusi commented Jul 16, 2020

Fixes #24

This is just an attempt, but I'm not committed to anything. The main challenge is that providers needs to be initialized, so we can't easily inject changes from options. Options I saw in order from least to most aggressive:

  1. Use similar environment variable technique as you did with git.
    • This might be the simplest and cleanest, its just missing clear documents and personally it makes me ask "shouldn't we be able to configure providers during arg parsing"?
  2. Pass an options object that is subject to change.
    • What I went with, but a little bleh for me imo. I'm not a huge fan of things patterns taking advantage of mutability.
  3. Add a new parameter to INuGet.InstallPackage that takes the nuget config directory, then somehow change the AssemblyProviderFactory post argument parsing.
    • This requires us to find the NuGetAssemblyProviderFactory and make changes to it post initialization. Get's a little gross and similar in problems as the preivous solution.
  4. Rework code to support getting the information about each provider so that it can be shown in help, but the initialization of the providers happens after argument parsing.

@kassemsandarusi
Copy link
Contributor Author

@Mpdreamz ping! If you're busy no worries, just hoping for this to get noticed.

@Mpdreamz
Copy link
Contributor

Mpdreamz commented Aug 4, 2020

Hey @kassemsandarusi you hit the nail on a sore spot :)

I totally agree this is overdue a revamp ideally everything is command line based.

We should do the parsing of the commandline before setting up the providers so things do not need to be mutable.

I'm also open to move to a different command line parser if that eases things.

I am happy to first review this PR and get it out there and if you are willing we can follow up trying to clean this up?

@Mpdreamz Mpdreamz added enhancement New feature or request v0.13.0 labels Aug 4, 2020
@russcam
Copy link
Contributor

russcam commented Aug 19, 2020

We should do the parsing of the commandline before setting up the providers so things do not need to be mutable.

++ to this. Looks like the instantiation of AssemblyProviderFactoryCollection can be moved to happen after options.Parse(args);

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

Labels

enhancement New feature or request v0.13.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pulling local/specified NuGet config.

3 participants