Questions tagged [command-line-arguments]

Programming command line utilities that take parameters.

This tag should have questions relating to programming command-line utilities that take arguments.

A command line argument is a parameter passed to a command line program. For instance git status is the Git command line program with the parameter status. Git then acts accordingly to that parameter.

Command line arguments are used in command line programs from the Command Prompt on Windows, a shell on Unix and the Terminal program on Mac OS. These are not visual GUI programs, they are text based.

Learn more: Wikipedia Article Command Line

5018 questions
2
votes
1 answer

Why do command line arguments behave strangely inside an ELSE?

I have a Windows batch-file named arg_parse.cmd that parses command line arguments under certain conditions. Under other conditions, it does something else. A minimal (not) working example is below: @ECHO OFF IF 0 == 1 ( REM Do nothing ) ELSE…
Jeff Irwin
  • 1,041
  • 8
  • 12
2
votes
2 answers

Why the quantity of command-line arguments changes when the application is started by the IDE vs an launcher?

Considering the following command-line arguments "alfa" "beta" "4" When I specify the Run>Parameters... for an project I'm working the application shows on Process Explorer as command-line: "c:\myapp\myapp.exe" "alfa" "beta" "4" And ParamCount…
Fabricio Araujo
  • 3,810
  • 3
  • 28
  • 43
2
votes
2 answers

C# Loading Data from an Associated File Type

I created a filetype of my own (.track), and was able to set the association in the publish options of my solution. After installing my program, double clicking on any .track file opens up my application. When this happens, I want the program to…
Bill
  • 47
  • 1
  • 8
2
votes
1 answer

How to show help for all subparsers in argparse when using a Class()

very new to working with argparse and the cmd line. I've started to build a parser that allows for a front-end user to enter in data via the cmd terminal. The parser is calling the API() class that I have created (which creates the SQLALCHEMY…
thesayhey
  • 938
  • 3
  • 17
  • 38
2
votes
1 answer

Get error message from Command Line Parser Library

I am using Command Line Parser Library for C# console application. How I can retreive error messages if error occurs? The use case is that this console app will be called from some another app and I want to provide to that app error message if some…
gandra404
  • 5,727
  • 10
  • 52
  • 76
2
votes
3 answers

C command line argument check

I have the below part of code in which I noticed that if I change the 0 to 1 the result is the same. I get the STACKprint(); with "on" as the second argument, nothing with anything else and if there is no argument I get a segmentation fault. I guess…
apot
  • 39
  • 1
  • 1
  • 4
2
votes
1 answer

Does boost program_options support off-switches (e.g. --no-myswitch or -s=no)

When I define a boolean switch for my program, say, ("foo,f", "frobnicate") I want to be able to say myprogram --foo myprogram --no-foo myprogram --foo=no or at the very least, the first and one of the second or the third. Does program_options…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
2
votes
4 answers

Processing command line argument

I've been working with OpenCV, and some of the example code I've seen uses the following to read in a filename. I understand that argc is the number of command line arguments that were passes, and argv is a vector of argument strings, but can…
SSilk
  • 2,433
  • 7
  • 29
  • 44
2
votes
2 answers

Teamcity- run custom script with parameter

I've created a project in Teamcity that runs command line Custom script. I want to add parameters to the script. something like: ./run.sh parameter I want to be able to enter different parameter when running the build. as I understand I can do it…
user2880391
  • 2,683
  • 7
  • 38
  • 77
2
votes
2 answers

command line arguments make file

So I know how to create variables and store values from command line. But normally, I would type my command this way: make run VAR="abc", and VAR will be assigned the new value "abc" However, if I want to do something like this VAR="abc" make run,…
SusN
  • 31
  • 2
2
votes
5 answers

How to add custom Java command-line options?

I'd like to add custom command-line options to my Java program. Here's an example: java -cp my.jar package.Main -i input.data -o output.data How can I achieve this. Currently I only get JVMJ9VM007E Command-line option unrecognised: -i Edit: The…
user321068
2
votes
1 answer

runas argument savecred and netonly are incompatible?

i wrote this: runas /netonly /user:DOMAIN\USERNAME /savecred "mmc dsa.msc" but with /netonly the argument /savecred don't work Someone help me?
2
votes
3 answers

Can I use .NET Remoting for the communication between a console app & a process which has created by same console app?(Both are in the same server)

I have developed some backend console apps which are supposed to run on the server. They are called Server Process and Server Agent. The Server Process always create instances of server agents (as a process) time by time, here is the code for…
2
votes
1 answer

How to identify user input help (/?) in batch file

Usually in most of the batch command, it uses /? to get the description or hel of the particular command. So is there a way to identify user is asking for the help by entering /? as argument (mybatchfilename /?) I have tried IF %1==/? goto Help. but…
Nayana Adassuriya
  • 23,596
  • 30
  • 104
  • 147
2
votes
2 answers

Changing the metavar value in argparse only in argument listing and not in its Usage

My question is similar to argparse help without duplicate ALLCAPS question. Though i would explain in brief what that question was and what my question is: I'd like to display argparse help for my options the same way the default -h,--help is,…
Rakholiya Jenish
  • 3,165
  • 18
  • 28