Giter VIP home page Giter VIP logo

orc.commandline's People

Contributors

averus-a avatar ceo1647 avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dmitry-vf avatar geertvanhorrik avatar github-actions[bot] avatar gitter-badger avatar michu avatar mkhomutov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orc.commandline's Issues

Changing Parse method

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Summary

More obvious behavior

API Changes

simple program, as visual example:

namespace ConsoleApp1
{
    using System;
    using Catel.IoC;
    using Orc.CommandLine;

    public class Program
    {
        public static void Main(string[] args)
        {
            var serviceLocator = ServiceLocator.Default;
            var cmdlineParser = serviceLocator.ResolveType<ICommandLineParser>();

            var context = new MyContext();

            var validation = cmdlineParser.Parse(args, context);

            Console.WriteLine($"Database: {context.DbPath}");
        }
    }

    public class MyContext : ContextBase
    {
        [Option("db", "database")]
        public string DbPath { get; set; }
    }
}

Intended Use Case

pay attention to three lines:

            var context = new MyContext();
            var validation = cmdlineParser.Parse(args, context);
            Console.WriteLine($"Database: {context.DbPath}");

here we define new context, pass it as a value(!) to the parser, and suddenly we get it changed (using SetValue in UpdateContext in Parsers\CommandLineParser.cs)

This is very unobvious behavior, as it seems to me, violating the ideology of C#

my suggestion is:
validation becomes part of ContextBase and Parse method return new context, like:

var context = cmdlineParser.Parse(args);

if (context.validation.HasErrors)
{
	// something bad happened
	return;
}

Console.WriteLine($"Database: {context.DbPath}");```

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/automerged_updates/0' of type object did not match one or more of the required schemas
The property '#/update_configs/0/automerged_updates/1' of type object did not match one or more of the required schemas
The property '#/update_configs/0/automerged_updates/2' of type object did not match one or more of the required schemas
The property '#/update_configs/0/automerged_updates/3' of type object did not match one or more of the required schemas

Please update the config file to conform with Dependabot's specification.

You can mention @dependabot in the comments below to contact the Dependabot team.

Parsing command line with CommandLineService is not working

Example command line:

c:\Source\MyApp\output\MyApp.exe -argument "1 2 3"

This removes the quotes of the command line arguments:

commandLineParser.Parse(commandLineService.GetCommandLine(), commandLineContext);

Workaround:

var commandLineArguments = System.Environment.GetCommandLineArgs().Skip(1).ToArray();
commandLineParser.Parse(commandLineArguments, commandLineContext);

"C:\Program Files (x86)" hardcoded

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • .NET Standard
  • .NET Core

Component

cake scripts

Version of Library

4.0.0

Version of OS(s) listed above with issue

Windows

Steps to Reproduce

see below

Expected Behavior

see below

Actual Behavior

This issue most likely affects all orc.* 4.0.0 repositories, so I make an issue not a PR

in files deployment/cake/installers-msix.cake and deployment/cake/lib-generic.cake in 4.0.0 branch
in lines
var directories = BuildContext.CakeContext.GetDirectories($@"C:/Program Files (x86)/Windows Kits/10/bin/10.0.*");

"C:/Program Files (x86)/" is a constant string. But this folder have different names in other languages (https://www.samlogic.net/articles/program-files-folder-different-languages.htm)

It's better to use Environment.SpecialFolder.ProgramFilesX86
or some other way to find SDK (https://stackoverflow.com/questions/35119223/how-to-programmatically-detect-and-locate-the-windows-10-sdk)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.