Questions tagged [command-line-parser]

The Command Line Parser Library offers to .NET CLR applications a clean and concise API for manipulating command line arguments and related tasks.

From the project's readme:

The Command Line Parser Library offers CLR applications a clean and concise API for manipulating command line arguments and related tasks, such as defining switches, options and verb commands. It allows you to display a help screen with a high degree of customization and a simple way to report syntax errors to the end user.

51 questions
1
vote
3 answers

Commandline Parsing For Multiple Verbs on single command

I am writing a console application where we have to update the multiple connection string on the installed application. I have used the "CommandLineParser" library with "Verb" feature. My requirement is to use a single command line to pass different…
Raajkumar
  • 857
  • 2
  • 13
  • 26
1
vote
3 answers

Command Line Parser missing library includes?

I am using the CommandLineParser and literally pasting the example code into my example project. I get alot of errors such as: Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name…
sazr
  • 24,984
  • 66
  • 194
  • 362
1
vote
1 answer

Parse paths ending with "\" with CommandLineParser?

In C# I parse a path ending with '\', like this: -p "C:\My Folder\". The problem is, when parsing I get C:\My Folder" (with the final quote), instead of just C:\My Folder. Is there a way to avoid this problem? I've already tried with…
Gabriel Duarte
  • 974
  • 1
  • 13
  • 28
1
vote
2 answers

set default command line option value at runtime

I am using CommandLine Parser Library to parse command line arguments within an application. There are some options that will in most cases be the same every time a user runs the application. Usually, I use the DefaultValue attribute so that if the…
denver
  • 2,863
  • 2
  • 31
  • 45
0
votes
1 answer

CommandLineParser: Required only if a value of another option is equal to?

Using https://github.com/commandlineparser/commandline I would like to set an Option as "Required" if the value parsed from another Option is equal to a particular value. [Option('f', "foo", Required = true, HelpText = "Name of process")] …
0
votes
1 answer

key values list in R for command line arguments

Rscript test.R ../Data/bam/a.bam:0 ../Data/bam/b.bam:0.1 ../Data/bam/c.bam:0.5 ../Data/bam/d.bam:1 I want to make a list of keys and values for commandline arguments. I have use following code. #test.R args <- commandArgs(trailingOnly =…
learner
  • 41
  • 4
0
votes
0 answers

CommandLineParser - Converting from 1.9.71 to 2.9.1, having issues

I am attempting to upgrade my commandlineparser code to the latest version and I am struggling. The program's requirements are pretty simple: must have one and only one parameter, with a choice between two options. Here is what I would ultimately…
Bryan Hunt
  • 145
  • 2
  • 5
0
votes
1 answer

CommandLindParser do not work with negative arguments (double)

To parse the command line arguments with OpenCV (C++) I have defined the keyString like that: const String keyStrings = "{@filepath | lena.jpg | input image}" "{@commandCode | color2BW | command code}" "{@alpha | 1.0 | alpha}" …
0
votes
1 answer

Create ParserResult from MapResult for the CommanLineParser

I noticed that MapResult does not have an overload for ParserResult. Is there a way to perform the same function that MapResult provides, and return a ParserResult rather than just an object or would I have to clone the repo and add this…
tsage080667
  • 89
  • 1
  • 10
0
votes
1 answer

How to catch that there is an error from CommandLineParser so I can return my own error codes?

How to catch that there is an error from CommandLineParser so I can return my own error codes? I need to return my own codes when my console application is called from say SSIS. class Program { static void Main(string[] args) { try …
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
0
votes
1 answer

CommandLine Parser verb not recognized

I am using the commandline parser to parse 2 verbs. Here is a code snippet: [Verb("Option1")] public class VerbOption1 { [Option('o', "option1")] public string Option1 { get; set; } } [Verb("Option2")] public class VerbOption2 { …
tsage080667
  • 89
  • 1
  • 10
0
votes
0 answers

If I don’t have any parameters, CommandLineParser with C# do not display my method

This code using the CommandLineParser library works. However, as soon as I don’t set a parameter, I can’t get the result of the return of the method DisplayHelp. My code works when I have parameters but don't when there aren't. This is my code : int…
Screenyx
  • 1
  • 1
0
votes
0 answers

Command Line Parser With Multiple Command Types

I'm creating a console app in .NET Core 5 which knows a set of commands. The name of the application is Strict.exe. These are the commands I need to parse. strict.exe load mytext strict.exe read strict.exe explode strict.exe stich 3 4 5 6 strict.exe…
Sangeeth Nandakumar
  • 1,362
  • 1
  • 12
  • 23
0
votes
1 answer

Command line Parser parses value eventhoug its not specified?

I have begun starting using this https://github.com/commandlineparser/commandline to pass the input parameters parsed to my application. My problem here is that the input parameter passed is not required, meaning you can start the application…
noob
  • 13
  • 3
0
votes
2 answers

CommandLineParser - Show --help results if no switch is given

Using the CommandLineParser NuGet, when I run my application with NO arguments, is it possible to forcefully show the --help results output just as if I was to run my application like... myapplication.exe --help Currently, when I run my application…
Arvo Bowen
  • 4,524
  • 6
  • 51
  • 109