ViewHelpForCommand() public method

public ViewHelpForCommand ( string commandName ) : void
commandName string
return void
Esempio n. 1
0
 public void Execute()
 {
     if (Help)
     {
         HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName);
     }
     else
     {
         ExecuteCommand();
     }
 }
Esempio n. 2
0
        public void Execute()
        {
            if (Help)
            {
                HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName);
            }
            else
            {
                if (String.IsNullOrEmpty(ConfigFile))
                {
                    Settings = NuGet.Settings.LoadDefaultSettings(
                        FileSystem,
                        configFileName: null,
                        machineWideSettings: MachineWideSettings);
                }
                else
                {
                    var directory        = Path.GetDirectoryName(Path.GetFullPath(ConfigFile));
                    var configFileName   = Path.GetFileName(ConfigFile);
                    var configFileSystem = new PhysicalFileSystem(directory);

                    // Create the config file when neccessary
                    if (!configFileSystem.FileExists(configFileName) &&
                        ShouldCreateConfigFile)
                    {
                        XmlUtility.CreateDocument("configuration", configFileSystem, configFileName);
                    }

                    Settings = NuGet.Settings.LoadDefaultSettings(
                        configFileSystem,
                        configFileName,
                        MachineWideSettings);
                }

                SourceProvider = PackageSourceBuilder.CreateSourceProvider(Settings);

                // Register an additional provider for the console specific application so that the user
                // will be prompted if a proxy is set and credentials are required
                var credentialProvider = new SettingsCredentialProvider(
                    new ConsoleCredentialProvider(Console),
                    SourceProvider,
                    Console);
                HttpClient.DefaultCredentialProvider = credentialProvider;
                RepositoryFactory = new NuGet.Common.CommandLineRepositoryFactory(Console);

                // enable the V3 shim
                if (ShimControllerProvider != null)
                {
                    ShimControllerProvider.Controller.Enable(SourceProvider);
                }

                ExecuteCommand();
            }
        }
Esempio n. 3
0
 public void Execute()
 {
     if (Help)
     {
         HelpCommand.ViewHelpForCommand(GetCurrentCommandName());
     }
     else
     {
         ExecuteCommand();
     }
 }
Esempio n. 4
0
        public void Execute()
        {
            if (Help)
            {
                HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName);
            }
            else
            {
                Stopwatch watch = new Stopwatch();
                watch.Start();
                if (String.IsNullOrEmpty(ConfigFile))
                {
                    Settings = NuGet.Settings.LoadDefaultSettings(
                        FileSystem,
                        configFileName: null,
                        machineWideSettings: MachineWideSettings);
                }
                else
                {
                    var directory        = Path.GetDirectoryName(Path.GetFullPath(ConfigFile));
                    var configFileName   = Path.GetFileName(ConfigFile);
                    var configFileSystem = new PhysicalFileSystem(directory);

                    // Create the config file when neccessary
                    if (!configFileSystem.FileExists(configFileName) &&
                        ShouldCreateConfigFile)
                    {
                        XmlUtility.CreateDocument("configuration", configFileSystem, configFileName);
                    }

                    Settings = NuGet.Settings.LoadDefaultSettings(
                        configFileSystem,
                        configFileName,
                        MachineWideSettings);
                }

                SourceProvider = PackageSourceBuilder.CreateSourceProvider(Settings);

                // Register an additional provider for the console specific application so that the user
                // will be prompted if a proxy is set and credentials are required
                var credentialProvider = new SettingsCredentialProvider(
                    new ConsoleCredentialProvider(Console),
                    SourceProvider,
                    Console);
                HttpClient.DefaultCredentialProvider = credentialProvider;

                ExecuteCommand();
                watch.Stop();
                DisplayExecutedTime(watch.Elapsed, CommandAttribute.CommandName);
            }
        }
        public void Execute()
        {
            if (Help)
            {
                HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName);
            }
            else
            {
                if (String.IsNullOrEmpty(ConfigFile))
                {
                    Settings = NuGet.Settings.LoadDefaultSettings(
                        FileSystem,
                        configFileName: null,
                        machineWideSettings: MachineWideSettings);
                }
                else
                {
                    var directory        = Path.GetDirectoryName(Path.GetFullPath(ConfigFile));
                    var configFileName   = Path.GetFileName(ConfigFile);
                    var configFileSystem = new PhysicalFileSystem(directory);
                    configFileSystem.Logger = Console;
                    Settings = NuGet.Settings.LoadDefaultSettings(
                        configFileSystem,
                        configFileName,
                        MachineWideSettings);
                }

                SourceProvider = PackageSourceBuilder.CreateSourceProvider(Settings);

                // Register an additional provider for the console specific application so that the user
                // will be prompted if a proxy is set and credentials are required
                var credentialProvider = new SettingsCredentialProvider(
                    new ConsoleCredentialProvider(Console),
                    SourceProvider,
                    Console);
                HttpClient.DefaultCredentialProvider = credentialProvider;
                RepositoryFactory = new NuGet.Common.CommandLineRepositoryFactory(Console);

                ExecuteCommand();
            }
        }