commandlineparser / commandline Goto Github PK
View Code? Open in Web Editor NEWThe best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support
License: MIT License
The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support
License: MIT License
Issue by crmckenzie
Tuesday Jan 14, 2014 at 18:47 GMT
Originally opened as gsscoder/commandline#115
-c false should turn off the switch for -c.
Issue by ekkis
Monday Sep 16, 2013 at 22:07 GMT
Originally opened as gsscoder/commandline#101
to help me with other issues I posted, I decided to pull in the whole project into my solution. upon compilation I get the error that ValueListAttribute cannot be found. indeed it's not there... I don't see another project I should also add... what next?
Issue by mr-miles
Wednesday Mar 26, 2014 at 18:36 GMT
Originally opened as gsscoder/commandline#122
Is it possible to use the parser to populate key-value pairs?
So something like "myapp.exe -v:a=x -v:b=y -v:c=z" would populate a property v which is a Dictionary<string, string> with (a,x), (b,y), (c,z) values?
I want to use the parser to specify replacements to be made on a text file
Great package by the way!
Issue by kirillkovalenko
Tuesday Aug 20, 2013 at 18:25 GMT
Originally opened as gsscoder/commandline#91
I've noticed several places with code such as:
if (string.IsNullOrWhiteSpace("message")) throw new ArgumentException("message");
These ifs will never get true value as far as I understand
Issue by issafram
Wednesday Aug 28, 2013 at 14:46 GMT
Originally opened as gsscoder/commandline#96
I have an application that will have 1 to many different arguments being passed in. The argument names will always be different depending on configuration (dynamic). So I will never know the name of the argument names as the designer of the application.
Does this library support something like that? It is great for parsing but it requires the options parameter to be defined. I have tried using an ExpandoObject but I don't think it works properly because attributes are required on the properties.
Issue by rupe120
Monday Jun 22, 2015 at 19:41 GMT
Originally opened as gsscoder/commandline#169
It would be helpful to be able to create more than one paragraph in the HelpText, for the instances where there is supplemental / conditional information to add.
I have a scenario where depending on the list of options supplied, a given option may have slightly different behavior and/or be required or not.
It tends to be helpful if the user can see clear separation between the default functionality of an option, and additional scenarios.
rupe120 included the following code: https://github.com/gsscoder/commandline/pull/169/commits
Issue by kirillkovalenko
Tuesday Aug 20, 2013 at 17:19 GMT
Originally opened as gsscoder/commandline#90
I suggest implementing verb aliases. For example: hg rename, hg move, hg mv is the same command.
Issue by wadewegner
Thursday Oct 01, 2015 at 18:07 GMT
Originally opened as gsscoder/commandline#249
I'm having an issue with the parser not figuring out my sub-options.
Here's the code in Main
:
var invokedVerb = "";
var invokedVerbInstance = new object();
var options = new Options();
if (!CommandLine.Parser.Default.ParseArguments(args, options,
(verb, subOptions) =>
{
// if parsing succeeds the verb name and correct instance
// will be passed to onVerbCommand delegate (string,object)
invokedVerb = verb;
if (!string.IsNullOrEmpty(invokedVerb))
invokedVerbInstance = subOptions;
}))
{
Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);
}
This is pretty much right from the wiki.
My options are defined as this:
class Options
{
public Options()
{
CpVerb = new CPSubOptions { };
}
[VerbOption("cp", HelpText = "Interact with cp.")]
public CPSubOptions CpVerb { get; set; }
[HelpVerbOption]
public string GetUsage(string verb)
{
return HelpText.AutoBuild(this, verb);
}
}
class CPSubOptions
{
[Option('n', "name", HelpText = "Get details name.")]
public string Name { get; set; }
}
When I run with cp
as the args, it works and the parser determines that CPSubOptions
is the subOptions
and invokedVerbInstance
is set appropriately.
However, when I run with cp --name blah
or cp -n blah
, the subOptions
is null, so it's not parsed properly.
Any help?
Issue by AndrewSav
Tuesday Sep 22, 2015 at 22:37 GMT
Originally opened as gsscoder/commandline#242
This is regarding 2.0
Issue by tombatron
Thursday Apr 04, 2013 at 01:55 GMT
Originally opened as gsscoder/commandline#74
... requested for.
Let's say that I have an application called 'example' that has a verb called 'dothing'. If I entered the following on the console:
example help dothing
The usage text displayed isn't for the verb specified but the default usage text.
tombatron included the following code: https://github.com/gsscoder/commandline/pull/74/commits
Issue by Rusk85
Saturday Aug 15, 2015 at 22:02 GMT
Originally opened as gsscoder/commandline#224
โฆ unit tests. I have refrained from altering the core logic. Instead I added two overloaded methods for Parser.ParseArguments(...) with an additional optional parameter "useWinStyleOptions" which is set to true per default. From there on I simply check all arguments for the win style flag ("/") and replace them with the stock double dashes ("--"). The result I pass to the original ParseArguments-Methods.
While as a personal preference I take unix style options over windows style options every day but there is a remote service I am using that is among other things capable of executing applications. I cant easily change the service - its fairly old and written in vb.net - but I checked the implementation. Turns out its capable of interpreting windows style options and passing that to the application it starts. So there you go.
There might be others in a similar situation to whom this could be a possible solution.
Please review the code.
Rusk85 included the following code: https://github.com/gsscoder/commandline/pull/224/commits
Issue by gsscoder
Saturday Jul 11, 2015 at 17:13 GMT
Originally opened as gsscoder/commandline#195
Has anyone some neat idea to re-organize test code?
I'd like to programmatically create it with https://github.com/AutoFixture/AutoFixture. Has anyone do it before?
I've also some more extreme idea, like porting test code to F# using https://github.com/mausch/Fuchu and https://code.google.com/p/unquote/.
(Maybe I'll start some experiment in a dev branch).
cc/ @mizipzor @nemec @gimmemoore
Issue by jawn
Wednesday Aug 12, 2015 at 08:58 GMT
Originally opened as gsscoder/commandline#223
Using the latest nuget of the version 2.0 pre-release, I can display help text like this:
var results = Parser.Default.ParseArguments<Options>(args)
.WithParsed(opts => /* handle options here */)
if (results.Tag == ParserResultType.NotParsed)
{
var helpText = HelpText.AutoBuild(results);
Console.WriteLine(helpText);
}
Is there a way to do this within the fluent syntax?
Something like
var results = Parser.Default.ParseArguments(args)
.WithNotParsed(opts => Console.WriteLine(HelpText.AutoBuild()));
.WithParsed(opts => /* handle options here */)
Since AutoBuild() requires results, this can't be called within the fluent syntax. That's already logged as #88, however I would like to know whether a different solution is available.
Issue by gsscoder
Saturday Aug 01, 2015 at 06:20 GMT
Originally opened as gsscoder/commandline#213
As you can see I've recently promoted the library from alpha to beta.
Please be patient if I'll not accept enhancement PR until it becomes stable.
As a developer you know that adding complexity will delay the consolidation of a stable code base, a solid prerequisite for proceeding with future changes.
Obviously I'll accept any fix, or better everyone is encouraged to submit fixes or also new tests to cover untested parts.
A good practice is always open issue, discuss and than submit a PR.
Thanks everyone!
cc/ @nemec @Thilas @mizipzor @gimmemoore
Issue by raymondb1
Wednesday May 14, 2014 at 15:24 GMT
Originally opened as gsscoder/commandline#128
Hi there,
Can I specify that certain parameter values are invalid? Something to the same effect of:
private string _server = null;
[Option('s', "server", Required = true, HelpText = "Some text here")]
public virtual string Server
{
get { return _server; }
set { if (string.Compare("localhost", value, true) == 0)
{
_server = null;
throw new ArgumentException("Localhost is not accepted as a server name.");
}
}
}
Of course, I can validate after parsing is complete, but I had to do it in many places. Is there a better way?
Thanks!
Issue by turch
Wednesday Mar 13, 2013 at 21:07 GMT
Originally opened as gsscoder/commandline#69
Using the sample code in https://github.com/gsscoder/commandline/wiki/Display-A-Help-Screen section "Handling Parsing Errors" to print errors:
RenderParsingErrorsText() returns a string with linebreaks if there are multiple errors. When passed to Add<>OptionsLine, it is wrapped every 80 characters regardless of newlines, causing incorrect wrapping.
[ParserState]
public IParserState LastParserState { get; set; }
[Option('a', "qwe", Required = true)]
public string a { get; set; }
[Option('b', "asd", Required = true)]
public double b { get; set; }
[Option('c', "zxc", Required = true)]
public bool c { get; set; }
[HelpOption]
public string GetUsage()
{
var help = new HelpText();
// ...
if (this.LastParserState.Errors.Count > 0)
{
var errors = help.RenderParsingErrorsText(this, 2); // indent with two spaces
if (!string.IsNullOrEmpty(errors))
{
help.AddPreOptionsLine(string.Concat("\n", "ERROR(S):"));
help.AddPreOptionsLine(errors);
}
}
// ...
return help;
}
>foo.exe
ERROR(S):
-a/--qwe required option is missing.
-b/--asd required option is
missing.
-c/--zxc required option is missing.
As you can see, the second error line gets incorrectly wrapped.
Issue by ekkis
Monday Sep 16, 2013 at 21:49 GMT
Originally opened as gsscoder/commandline#100
I've defined an option like this:
[Option('s', HelpText = "Save name", DefaultValue="Main")]
public string SaveName { get; set; }
but when I run my programme as:
c:> test ./file-to-munch.txt -s
I get a failure of ParseArgumentsStrict. what have I done wrong?
Issue by wpeti
Thursday Sep 10, 2015 at 15:04 GMT
Originally opened as gsscoder/commandline#240
I hope I'm not using the library in the right way, but i just came across this issue:
I have an option class with a property called "Path", designed to be used as input container of folder or file paths. In case the user is trying to pass a value to this option by using the --Path= argument he/she experiences errors sometime. The cause of this is that they sometime pass on directory paths with a backslash in the end, like so: --Path="c:\test folder". In this unfortunate case the ending quotation mark is not recognized by the parser library and it parses the faulty "c:\test " argument value into my options object.
I'm not an expert of this library and I haven't checked every line of it's code (so far) but would say it's a bug which doesn't have any workaround implemented at the moment.
Issue by gsscoder
Sunday Jul 05, 2015 at 15:59 GMT
Originally opened as gsscoder/commandline#182
I want to be able to parse this:
$ app --webserver localhost 8080
to:
class Options {
[Option]ย public Tuple<string, int> WebServer { get; set; }
}
Opinions? cc/ @mizipzor @nemec @gimmemoore
Issue by kensykora
Thursday Oct 01, 2015 at 14:39 GMT
Originally opened as gsscoder/commandline#247
I am wanting to display help options for my verb class that doesn't include a concrete example. Currently this isn't supported, at least as far as I can tell.
e.g.,
USAGE: push-registration register platform token [tags1 tags2 ... tagn] [-c connectionString] [-h hubName]
<Example Name>:
push-registration register ios abc123 tag1 tag2
Currently that first line is what I can't figure out what the best way is to spit that out with autohelp
Issue by nemec
Friday Apr 12, 2013 at 21:29 GMT
Originally opened as gsscoder/commandline#81
I would expect the default value to not be used unless the option was provided but without a value. Otherwise, it kind of duplicates the functionality of the constructor (but more limited since Attributes may only contain constant values).
For example, when parsing the following class:
public class Config
{
[Option('v', DefaultValue = "Other")]
public string Value { get; set; }
public Config()
{
Value = "Initial";
}
}
I would expect the following:
Program.exe
> Value == Initial
Program.exe -v
> Value == Other
Program.exe -v Overwrite
> Value == Overwrite
Issue by davhdavh
Friday Aug 28, 2015 at 10:13 GMT
Originally opened as gsscoder/commandline#232
There seems to be no support for NOT depending on the OS parsing of the arguments string.
In my case, I am parsing a command line from a chat program.
Issue by wags1999
Thursday Oct 17, 2013 at 19:14 GMT
Originally opened as gsscoder/commandline#104
In version 1.9.71.2, when using ValueOptionAttributes to define order-specific parameters (I'm using this for backwards compatibility), if I set any properties as Required, the parsing thinks it fails. This is because in OptionMap.cs, in EnforceRequiredRule, the option.IsDefined has never been set in the Parser.DoParseArgumentsCore() and subsequent valueMapper.MapValueItem() methods.
Issue by sgrassie
Friday Jul 17, 2015 at 10:56 GMT
Originally opened as gsscoder/commandline#201
I'd like to allow the following scenarios:
$ app verb -t
$ app verb childverb -u
$ app verb otherchildverb -z
Where -u
and -z
are both specific to the respective child verbs. Is the documentation in the wiki for this still valid, or has it changed in 2.0+?
Issue by st1led
Tuesday Apr 09, 2013 at 09:55 GMT
Originally opened as gsscoder/commandline#76
Hi everybody, is there a way in CommandLine (I guess in a way similar to what is done with mutually exclusive properties) to specify that an option requires another option to be set? This is a short example:
[Option('v', "verbose",
Required = false,
DefaultValue = false,
HelpText = "Prints log messages.")]
public bool Verbose { get; set; }
[Option('o', "optional-operation",
Required = false,
DefaultValue = false,
HelpText = "Performs an operation (a.k.a. \"does something\") in the code.")]
public bool PerformOperation { get; set; }
[Option('t', "time-limit",
Required = false,
DefaultValue = false,
HelpText = "Requires option -o. Specifies a time limit for the optional operation")]
public int OperationTimeLimit { get; set; }
In this scenario, one would want to allow command line arguments like -o
and -vot
but not -vt
or -t
for instance, since in the latter the option -t
is specified without -o
. Is this currently possible in CommandLine?
Regards,
Stefano
Issue by akfish
Thursday Oct 31, 2013 at 19:48 GMT
Originally opened as gsscoder/commandline#107
I am trying to make an app with multiple level of verbs, something like:
app repo list
app repo add
app account list
What I tried is:
class Options
{
#region Global Options
//...
#endregion
#region Help
//..
#endregion
#region Verbs
[VerbOption("account", HelpText = "Manage mail accounts")]
public AccountOptions AccountVerb { get; set; }
[VerbOption("repo", HelpText = "Manage repositories")]
public RepoOptions RepoVerb { get; set; }
#endregion
}
In each verb, nested a sub verb:
class AccountOptions : IOptions
{
[VerbOption("add", HelpText = "Add an account")]
public AddOption AddVerb { get; set; }
//And so on....
public class AddOption : IOptions
{
}
//And so on....
}
main:
class Program
{
static void Main(string[] args)
{
string theVerb = null;
IOptions theOptions = null;
var options = new Options();
if (CommandLine.Parser.Default.ParseArguments(args, options, (verb, subOptions) =>
{
theVerb = verb;
if (verb != null)
theOptions = subOptions as IOptions;
}))
{
theOptions.Execute(options);
}
else
{
Console.Error.WriteLine("Command line parsing error.");
}
}
}
I was able to get first level of verbs to working (e.g. app repo
, app account
, as the documents said. But the second level ones (app account list
, app account add
) didn't.
So is there a way to do this? Thanks.
Issue by attilah
Monday Aug 26, 2013 at 21:06 GMT
Originally opened as gsscoder/commandline#93
For this declaration
[Value(0, Required = true)]
public DateTime FromDate { get; set; }
I'm not getting any error, when I don't have any values on the command line.
Issue by netxph
Tuesday Jun 16, 2015 at 09:28 GMT
Originally opened as gsscoder/commandline#163
I'd like to mimic this...
app.exe -type SomeType
app.exe SomeType
[ValueOption(0)]
[Option('t', "typeName", Required=true)]
public string TypeName { get; set; }
Having this option gives parsing error on app.exe SomeType
. Any suggestions recommendations?
Issue by gsscoder
Thursday May 28, 2015 at 18:24 GMT
Originally opened as gsscoder/commandline#152
I apologize for not being able to coordinate issues, pull requests and for not replying to all emails.
I was very engaged in various heavy and challenging projects around Europe.
I next days (or may be weeks) I'll try to catch up with everything...
For now I repeat what I've said to few (of many, sorry) emails I've replied: please use the consolidated code base of latest stable on branch stable-1.9.71.2.
At the moment I can't make any preview for the future: maybe the new pre-release 2.0.0.0 (actual master branch) will be discarded, maybe not or maybe both versions will go ahead together. As always suggestions are welcome.
EDIT
EDIT 2
Regards,
Giacomo Stelluti Scala
Issue by Sirais
Friday Aug 07, 2015 at 10:35 GMT
Originally opened as gsscoder/commandline#221
in the Wiki at
https://github.com/gsscoder/commandline/wiki/Quickstart
is the quickstart example to parse the commandline args into n Object using the following
example. still the same as the "old" lib i was using.
...
var options = new Options();
if (CommandLine.Parser.Default.ParseArguments(args, options))
...
now it seems to be completely different way and currently Blindsighted or something. but i cant see how i can parse the commandline into an Object anymore.
any hints ?
Issue by kns98
Tuesday Feb 24, 2015 at 20:54 GMT
Originally opened as gsscoder/commandline#148
kns98 included the following code: https://github.com/gsscoder/commandline/pull/148/commits
Issue by apla
Thursday Jun 18, 2015 at 11:06 GMT
Originally opened as gsscoder/commandline#165
I'm trying to couple commandline Options
class with ConfigurationManager.AppSettings
to make configuration persistent. For now (with stable version 1.9.x) I ended with such piece of code:
public Options (string[] args) {
// TODO: redesign without reflections
var pis = this.GetType().GetProperties().Where(prop => prop.IsDefined(typeof(OptionAttribute), false));
foreach (var pi in pis) {
var optAttr = pi.GetCustomAttributes(typeof(OptionAttribute), false).FirstOrDefault() as OptionAttribute;
if (optAttr == null)
continue;
optAttr.DefaultValue = optAttr.DefaultValue ?? ConfigurationManager.AppSettings[optAttr.LongName];
}
// here we use CommandLine to initialize this class
using (var parser = new CommandLine.Parser(settings => { settings.HelpWriter = Console.Error; settings.IgnoreUnknownArguments = false; }))
...
Maybe you can propose better way to enumerate properties?
Issue by issacg
Wednesday Dec 18, 2013 at 10:09 GMT
Originally opened as gsscoder/commandline#114
Hi
In my use-case, I needed to (occasionally) construct command line parameters for another instance of my process, and overloaded my class' ToString method to do so. I'd love to contribute the code back, but not sure if it's something that's needed, or where the best place in the library would be to put it.
I've included the code here, and if there is interest, and someone would give me some basic guidance as to where the correct place to add this to the library would be, I'd be happy to make a pull request (time permitting ;))
class MyArguments {
// Add some option-properties
public override string ToString()
{
string res = "";
// Get a list of all properties with OptionAttribute
var props = this.GetType().GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(OptionAttribute)));
// Now search the list to extract the attribute data
foreach (PropertyInfo prop in props)
{
object[] attrs = prop.GetCustomAttributes(true);
foreach (object attr in attrs)
{
OptionAttribute oa = attr as OptionAttribute;
if (oa != null)
{
// We found an OptionAttribute!
Type t = prop.GetType();
var data = prop.GetValue(this, null);
// Check if value is "default(t)" or not
if (data != (t.IsValueType ? Activator.CreateInstance(t) : null))
{
// Only print out non-empty parameters
res += "--" + oa.LongName + " " + data.ToString() + " ";
}
}
}
}
return res;
}
}
Issue by kolbasov
Friday Jan 31, 2014 at 11:12 GMT
Originally opened as gsscoder/commandline#116
When I try to get a help for a verb with no options using version 2.0.0.0:
app.exe help verb
I get the following:
App 1.0.0.0
Copyright (c) 2014
--help Display this help screen.
That makes sense since the verb has no options. However, it would be helpful to have something like GetUsage from the version 1.9 for printing more descriptive message. Is it possible in version 2.0.0.0?
Issue by gsscoder
Sunday Jul 12, 2015 at 17:21 GMT
Originally opened as gsscoder/commandline#196
If anyone find bad English forms and grammatical issues, please fix it!
Actual priority:
For point 3 we can wait a more stable version of 2.0, when info about previous stable will be replaced.
Issue by austinwagner
Friday Jul 10, 2015 at 20:17 GMT
Originally opened as gsscoder/commandline#194
The current method of using verbs seems more verbose than it needs to be.
I would like to suggest an attribute that can be applied to a method within option classes marked as verbs that contain the code to execute when the verb is invoked.
[Verb("dosomething")]
class DoSomethingOptions
{
[Option("foo")]
public string Foo { get; set; }
[VerbAction]
public int Run()
{
Console.WriteLine(this.Foo)
}
}
This could simplify the call to ParseArguments down to something along the lines of Parser.Default.ParseArguments<DoSomethingOptions, DoSomethingElseOptions>(args).Run()
Issue by zii-dmg
Thursday Jun 20, 2013 at 07:27 GMT
Originally opened as gsscoder/commandline#88
Using commit e00dd9f.
Sometimes Parser.ParseArguments throws exceptions (for example, InvalidOperationException: "Sequence contains more than one matching element") and ParseResult doesn't created, but I still need to show help usage to user. Without ParserResult I can't do this easily.
Or maybe I doesn't understand how to use help usage auto generation on exceptions.
Issue by sushihangover
Friday Jun 12, 2015 at 16:09 GMT
Originally opened as gsscoder/commandline#158
I am looking for a little assistance in seeing if I can parse plus/minus (inclusion/negation) arguments with 'commandline'.
i.e. Argument options like:
Maybe I am just missing something or I have not had enough coffee, but this one is stumping me.
Issue by yurikus
Sunday Oct 04, 2015 at 15:54 GMT
Originally opened as gsscoder/commandline#251
I added rudimentary ability to parse System.Guid, please review and merge.
yurikus included the following code: https://github.com/gsscoder/commandline/pull/251/commits
Issue by aggieben
Wednesday Oct 14, 2015 at 02:03 GMT
Originally opened as gsscoder/commandline#256
Here's the output when I try to run my command with --help
:
sbAppDev@sb-docker:~/proj/cm-core/src/Cm.Util$ dnx cmutil dbm --help
info : [Cm.Util] Running cmutil 1.0.0-beta in /home/sbAppDev/proj/cm-core/src/Cm.Util
info : [Cm.Util] LogLevel configured to Information
System.InvalidOperationException: CopyrightInfo::Default requires that you define AssemblyCopyrightAttribute or AssemblyCompanyAttribute.
at CSharpx.MaybeExtensions.FromJustOrFail[AssemblyCompanyAttribute] (CSharpx.Maybe`1 maybe, System.Exception exceptionToThrow) [0x00000] in <filename unknown>:0
at CommandLine.Text.CopyrightInfo.get_Default () [0x00000] in <filename unknown>:0
at CommandLine.Text.HelpText.AutoBuild[Object] (CommandLine.ParserResult`1 parserResult, System.Func`2 onError, System.Func`2 onExample, Boolean verbsIndex) [0x00000] in <filename unknown>:0
at CommandLine.Text.HelpText.AutoBuild[Object] (CommandLine.ParserResult`1 parserResult) [0x00000] in <filename unknown>:0
at CommandLine.Parser+<>c__DisplayClass17_0`1[System.Object].<DisplayHelp>b__1 (IEnumerable`1 _, System.IO.TextWriter writer) [0x00000] in <filename unknown>:0
at CSharpx.MaybeExtensions.Do[IEnumerable`1,TextWriter] (CSharpx.Maybe`1 maybe, System.Action`2 action) [0x00000] in <filename unknown>:0
at CommandLine.Parser+<>c__DisplayClass17_0`1[System.Object].<DisplayHelp>b__0 (IEnumerable`1 errors) [0x00000] in <filename unknown>:0
at CommandLine.ParserResultExtensions.WithNotParsed[Object] (CommandLine.ParserResult`1 result, System.Action`1 action) [0x00000] in <filename unknown>:0
at CommandLine.Parser.DisplayHelp[Object] (CommandLine.ParserResult`1 parserResult, System.IO.TextWriter helpWriter) [0x00000] in <filename unknown>:0
at CommandLine.Parser.MakeParserResult[Object] (CommandLine.ParserResult`1 parserResult, CommandLine.ParserSettings settings) [0x00000] in <filename unknown>:0
at CommandLine.Parser.ParseArguments (IEnumerable`1 args, System.Type[] types) [0x00000] in <filename unknown>:0
at CommandLine.ParserExtensions.ParseArguments[SupervisorCommand,MigrationsCommand] (CommandLine.Parser parser, IEnumerable`1 args) [0x00000] in <filename unknown>:0
at Cm.Util.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain (Microsoft.Dnx.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0
at Microsoft.Dnx.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0
Exact same code and dnx version works fine on Windows desktop CLR.
Stack:
Mono 4.0.4 (Stable 4.0.4.1/5ab4c0d)
dnx 1.0.0-beta7 Mono/Linux/x64
Issue by coyot
Tuesday Nov 19, 2013 at 14:26 GMT
Originally opened as gsscoder/commandline#109
According to the https://github.com/gsscoder/commandline/wiki/Mutually-Exclusive-Options
this works like that:
;; permitted
$ app --enablejavascript --documentroot ~/var/local/website
;; denied
$ app --anonymouslogin --enablejavascript
BUT based on my research - this works exactly OPPOSITE! You are able to set values from DIFFERENT sets, not set values which are in the same "mutually exclusive set" - this is correct name, but this does not work as described...
Issue by eakoning
Wednesday Jul 15, 2015 at 14:24 GMT
Originally opened as gsscoder/commandline#199
I'm using CommandLine version 1.9.71.2
If i specify an AssemblyTitleAttribute
with a dotted name (and I version my tool 1.10.1.* through the AssemblyVersionAttribute) in the project's AssemblyInfo.cs file, e.g.
[assembly: AssemblyTitle("my.favorite.tool")]
the Copyright and Heading properties on HelpText when using the AutoBuild show
my.favorite 1.10.1.27342
Changing the assembly title to
[assembly: AssemblyTitle("my.great.fantastic.favorite.tool")]
changes Copyright and Heading properties to
my.great.fantastic.favorite 1.10.1.27342
It always leaves out the word after the last dot.
When I leave out the AssemblyTitleAttribute
all together, the HelpText falls back to the text specified in the AssemblyProductAttribute
and that seems to be working fine.
Issue by kensykora
Thursday Oct 01, 2015 at 14:32 GMT
Originally opened as gsscoder/commandline#246
When I create a verb object with a verb that has an enum value option, the help for the verb is not rendering. See example here: https://gist.github.com/kensykora/f486cdf239a823390409
Basically, any enum that's a positional parameter doesn't show up in autobuild help. It'd also be nice if the enum displayed it's string value rather than the int value, maybe even used the System.ComponentModel.DescriptionAttribute option?
Issue by tbroust-trepia
Friday Sep 12, 2014 at 08:09 GMT
Originally opened as gsscoder/commandline#136
If you provided "-2.5" as a parameter value, the library was basically considering it wasn't a value, but another parameter, because of both the negative sign and the dot. This fixes it.
tbroust-trepia included the following code: https://github.com/gsscoder/commandline/pull/136/commits
Issue by Ehryk
Saturday Aug 01, 2015 at 06:05 GMT
Originally opened as gsscoder/commandline#212
Persuant to issue #108, I have renamed the default tokenizer to TokenizerGetOpt, and added TokenizerWindows (currently just '/', '//'
variant of TokenizerGetOpt), and TokenizerHybrid (allowing both '-','/' and '--','//'
together). I also added a ITokenizer interface to set a standard for possibly other tokenizers.
Because static classes cannot implement interfaces, the tokenizers are no longer static and must be instantiated before use (which is now done so using TokenizerGetOpt).
Ehryk included the following code: https://github.com/gsscoder/commandline/pull/212/commits
Issue by davhdavh
Monday Aug 31, 2015 at 09:05 GMT
Originally opened as gsscoder/commandline#235
davhdavh included the following code: https://github.com/gsscoder/commandline/pull/235/commits
Issue by jogibear9988
Thursday Nov 21, 2013 at 06:46 GMT
Originally opened as gsscoder/commandline#111
jogibear9988 included the following code: https://github.com/gsscoder/commandline/pull/111/commits
Issue by bergbria
Monday Sep 28, 2015 at 17:27 GMT
Originally opened as gsscoder/commandline#245
I'd like to create an option where there is a known, restricted set of valid values which cannot be expressed in C# as the name of an enum. For example, the set might look like {8.0, 8.1, 9.0}. Is there any way to express this using this library?
If not, what would be the best way to add support for this? A custom attribute for enum fields, another parameter for the Option attribute?
Issue by gsscoder
Tuesday Jul 07, 2015 at 16:17 GMT
Originally opened as gsscoder/commandline#187
How would you add that to the project?
Probably is HelpText
quite customizable to support it as now?
cc/ @nemec @mizipzor @gimmemoore or everyone
Issue by gsscoder
Wednesday Jun 10, 2015 at 04:29 GMT
Originally opened as gsscoder/commandline#153
Need commit access?
Ask me.
Regards,
Giacomo
PS:
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.