wildgums / orc.commandline Goto Github PK
View Code? Open in Web Editor NEWCommand line arguments made easy
License: Other
Command line arguments made easy
License: Other
More obvious behavior
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; }
}
}
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}");```
cake scripts
4.0.0
Windows
see below
see below
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)
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.
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);
Dependabot couldn't reach https://wildgums.myget.org/F/wildgums/api/v3/index.json as it timed out.
Is https://wildgums.myget.org/F/wildgums/api/v3/index.json accessible over the internet? If it is then this may be a transitory issue and can be ignored - Dependabot will close it on its next successful update run.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.