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
3 answers

How to change the cmd window via batch?

I want to use batch to make small apps but the size of the window is too large. I can manually change it via properties but that is not what I need for multiple windows. Is it possible to change the size of a command line window via batch?
2
votes
1 answer

How to input a parameter in a custom target with cmake

I have a custom target: add_custom_target( create-po COMMAND ${MSGINIT} --no-translator -i "${PROJECT_SOURCE_DIR}/data/${PACKAGE}.pot" - "${PROJECT_SOURCE_DIR}/po/es.po" -l es_MX.utf8 ) so, is invoked like this: # make create-po my…
Joel
  • 1,805
  • 1
  • 22
  • 22
2
votes
2 answers

Debug SSIS package with parameters/ Arguments

I'm hopeful one of you guys can help me with the following question. Question: Is it possible to pass command line arguments to a package when running it from within Visual Studio/BIDS? I want to set the value of a variable via the command line,…
2
votes
1 answer

How to get the argument after the less than symbol (<) in bash script?

For example, I have ./run.sh < file.dat How do I get the argument "file.dat" in run.sh?
Fei
  • 117
  • 2
  • 7
2
votes
1 answer

Octave script: Command line Arguments as xlim/ylim

I am trying to pass the values for xlim and ylim into my octave script as command line arguments. What I curently have is: arg_list = argv (); filename = arg_list{1}; minVal = arg_list{2}; maxVal = arg_list{3}; if (minVal >= maxVal) disp(["min ("…
cLar
  • 280
  • 1
  • 3
  • 17
2
votes
2 answers

GetOpt-like Behavior in PowerShell

I'm in the process of converting a Korn shell script to PowerShell. The existing script utilizes the getopt command and makes use of case sensitive command line arguments (e.g., v behaves differently than V). set -- `getopt…
javacavaj
  • 2,901
  • 5
  • 39
  • 66
2
votes
2 answers

How to set default values for GetOpt?

I thought it was as easy as: my $man = 0; my $help = 0; my @compList = ('abc', 'xyz'); my @actionList = ('clean', 'build'); ## Parse options and print usage if there is a syntax error, ## or if usage was explicitly requested. GetOptions('help|?' =>…
MrDuk
  • 16,578
  • 18
  • 74
  • 133
2
votes
4 answers

usage: command not found

I have a file parsing option flags from command line input, and if you pass in -h, it's giving an error. h) usage exit 1 ;; returns: usage: command not found Does anybody know what’s going on here? I've found many examples that use usage,…
Francis Lewis
  • 8,872
  • 9
  • 55
  • 65
2
votes
1 answer

How to save command-line-arguments in a variable and pass them to the command

i want to put some arguments into a variable f.e. CFLAGS=-c --sysroot=$sysroot but bash complains that it does not find the file --sysroot... why? How can I put this arguments into the variable and pass them later to the program. Additionally i…
Daniel Bişar
  • 2,663
  • 7
  • 32
  • 54
2
votes
3 answers

C# Compact-Framework friendly command line parser

I read this question: Command Line Parser for .NET. I thought that was what I was looking for, but the library Command Line Parser Library is not Compact framework friendly... I REALLY don't want to write a CL parser and I have been drifting away…
Shaihi
  • 3,952
  • 4
  • 27
  • 47
2
votes
0 answers

How to read command line arguements in cordova

I am an extremely newbie in working in cordova/phonegap app development and would like to implement a function to read in the command line arguements supplied to cordova For an example if I write the following code: cordova build android…
Dref D
  • 257
  • 2
  • 17
2
votes
2 answers

java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl

I am writing a command for a maven project in Java using the 'CommandLine' class. The command will take two integer values as parameters on a command line and displays its sum. However, my project does not build and throws exception as…
noobcoder
  • 11,983
  • 10
  • 39
  • 62
2
votes
1 answer

How do I run a javascript within html from the command line and include arguments?

I have an html javascript program that opens 4 browser windows. I want to run this from the command line and include arguments that specify the URLs to be opened. Is this possible? The current code looks like this: