tagged [arguments]

Console app arguments, how arguments are passed to Main method

Console app arguments, how arguments are passed to Main method This would be question from c# beginner. When I create console application I get Main method with parameter as array string. I do not und...

26 Jan at 10:35

Pass argument to AsyncCallback function?

Pass argument to AsyncCallback function? I'm learning socket programming and I have the following function: and this is how the callback gets set: The problem is I need to pass another argument to OnD...

8 Feb at 11:46

Parsing Command Line Arguments in C++?

Parsing Command Line Arguments in C++? What is the best way of parsing command-line arguments in C++ if the program is specified to be run like this: Is there some way of doing this built into the sta...

10 Feb at 23:58

Pass a variable to a PHP script running from the command line

Pass a variable to a PHP script running from the command line I have a PHP file that is needed to be run from the command line (via [crontab](https://en.wikipedia.org/wiki/Cron#Overview)). I need to p...

How to expand a list to function arguments in Python

How to expand a list to function arguments in Python Is there syntax that allows you to expand a list into the arguments of a function call? Example: ``` # Trivial example function, not meant to do an...

9 Mar at 10:14

Accessing bash command line args $@ vs $*

Accessing bash command line args $@ vs $* In many SO questions and bash tutorials I see that I can access command line args in bash scripts in two ways: Which results in: What is the difference betwee...

3 Nov at 07:9

How to have multiple conditions for one if statement in python

How to have multiple conditions for one if statement in python So I am writing some code in python 3.1.5 that requires there be more than one condition for something to happen. Example: The problem is...

How do I parse command line arguments in Bash?

How do I parse command line arguments in Bash? Say, I have a script that gets called with this line: or this one: What's the accepted way of parsing this such that in each case (or some combination of...

C# Passing Function as Argument

C# Passing Function as Argument I've written a function in C# that does a numerical differentiation. It looks like this: I would like to be able to pass in any function, as in: ``` public double Diff(...

21 Mar at 23:8

Meaning of "[: too many arguments" error from if [] (square brackets)

Meaning of "[: too many arguments" error from if [] (square brackets) I couldn't find any one simple straightforward resource spelling out the meaning of and fix for the following BASH shell error, so...

8 May at 23:26

Best way to check function arguments?

Best way to check function arguments? I'm looking for an efficient way to check variables of a Python function. For example, I'd like to check arguments type and value. Is there a module for this? Or ...

6 Apr at 01:56

"TypeError: method() takes 1 positional argument but 2 were given" but I only passed one

"TypeError: method() takes 1 positional argument but 2 were given" but I only passed one If I have a class ... ... which I use to create an object ... ... on which I call `method("foo")` like so ... `...

20 Feb at 16:59

How can I find out if an .EXE has Command-Line Options?

How can I find out if an .EXE has Command-Line Options? Suppose you have an .EXE and you want to check if it has Command-Line Options. How can one know if the .EXE has this ability. In my case I know ...

Argument list too long error for rm, cp, mv commands

Argument list too long error for rm, cp, mv commands I have several hundred PDFs under a directory in UNIX. The names of the PDFs are really long (approx. 60 chars). When I try to delete all PDFs toge...

11 Nov at 17:28

How to send argument to class in Quartz.Net

How to send argument to class in Quartz.Net I'm using Quartz.Net (version 2) for running a method in a class every day at 8:00 and 20:00 (IntervalInHours = 12) Everything is OK since I used the same j...

Passing lengthy strings (as an argument) into a console application

Passing lengthy strings (as an argument) into a console application I'm creating a console application in C# to which, at execution, it is passed a bunch of data. Three of them are short strings, such...

How do I call a specific Method from a Python Script in C#?

How do I call a specific Method from a Python Script in C#? I'm wondering if there is a possibility to call a specific Method from a Python script over a C# project. I have no code... but my idea is: ...

Multiple optional parameters calling function

Multiple optional parameters calling function Assume that i have a function like this below It takes 3 parameters and 2 have optional values now i want to call this function like below how possible ? ...

Best way to parse command line arguments in C#?

Best way to parse command line arguments in C#? When building console applications that take parameters, you can use the arguments passed to `Main(string[] args)`. In the past I've simply indexed/loop...

23 May at 11:54

WPF Command Line Arguments, a smart way?

WPF Command Line Arguments, a smart way? I'm looking for a way that I can parse command line arguments into my WPF application with just a way of reading the value of the argument that the user passed...

10 Nov at 10:20

Endless method arguments of the same type

Endless method arguments of the same type I remember that I have red somewhere that you can create a method that takes endless arguments. The problem is that I don't remember how to do it. I remember ...

3 Jan at 20:24

build argument lists containing whitespace

build argument lists containing whitespace In bash one can escape arguments that contain whitespace. This also works for arguments to a command or function: So far so good, but what if I want to manip...

17 Jan at 20:39

find: missing argument to -exec

find: missing argument to -exec I was helped out today with a command, but it doesn't seem to be working. This is the command: The shell returns ``` find: missing argument to `-exec' ``` What I am bas...

19 Jun at 03:59

How do I pass a command line argument while starting up GDB in Linux?

How do I pass a command line argument while starting up GDB in Linux? I have to debug a program that has errors in it as part of my assignment. However, I must first pass command line arguments in ord...

When implementing command line flags, should I prefix with a fowardslash (/) or hyphen (-)?

When implementing command line flags, should I prefix with a fowardslash (/) or hyphen (-)? Are their any conventions (either written or just generally understood) for when to use a (/) or a (-) when ...