Questions tagged [args]

Common abbreviation for "arguments", often used in reference to command-line arguments or function arguments.

A program can accept any number of arguments from the command line. This allows the user to specify configuration information when the program is launched.

The user enters command-line arguments when invoking the application and specifies them after the name of the command to be run.

898 questions
7
votes
1 answer

Docker can't use args in docker-compose (use args from .env)

i want to pass some args i define in my .env file to the build process of my container .env file: OS_USER_UID=999 docker-compose: app: build: . args: - OS_USER_UID=$OS_USER_UID but this alsways results in: Unsupported config…
user11684966
7
votes
1 answer

How to format long lines of argument description in Google docstring style

This is an excerpt from a Google style docstring: def function_with_types_in_docstring(param1, param2): """Example function with types documented in the docstring. `PEP 484`_ type annotations are supported. If attribute, parameter, and …
Ivo
  • 71
  • 1
  • 3
7
votes
1 answer

Pass !, !=, ~, <, > as parameters

I want to be able to pass arguments like this: fn(a>=b) or fn(a!=b) I saw this behavior in DjangoORM and SQLAlchemy but I don't know how to achieve it.
6
votes
1 answer

GraphQL + NestJS - how can I access @Args in a guard?

I need the to somehow access the objectId from @Args inside the guard so as to check if the sender has the objectId assigned to his account. Any idea how I could implement it? @Query(() => [Person]) @UseGuards(ObjectMatch) async…
h4sop
  • 139
  • 9
6
votes
1 answer

How to send a POJO as a callback param using PrimeFaces' RequestContext?

I can send callback param(s) and it works perfectly as long as I am only sending some primitive types like String. But the same thing does not work for even the simplest POJO. PrimeFaces guide says that the RequestContext.addCallbackParam() method…
Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
6
votes
1 answer

how to upload multiple files with flask_restful?

I'm trying upload multiple files with flask_restful, but can't get the files name list in the arguments except the first file name, how can i get the files list with args? here is my code, from models import Server import werkzeug from werkzeug…
user7433411
  • 61
  • 1
  • 3
6
votes
1 answer

perl6 How to read from stdin and take command line args?

I need to pipe the result of "cat variousFiles" to a perl6 program while requiring the program to take different command line arguments. Perl6 seems to want to take the first argument as a file to be read. I can re-write my routines, but I want to…
lisprogtor
  • 5,677
  • 11
  • 17
6
votes
2 answers

powershell: script with variable args

I want to start a script1.ps1 out of an other script with arguments stored in a variable. $para = "-Name name -GUI -desc ""this is the description"" -dryrun" . .\script1.ps1 $para The args I get in script1.ps1 looks like: args[0]: -Name name…
lepi
  • 83
  • 2
  • 4
6
votes
2 answers

Store Bash script arguments $@ in a variable

How can I store $@ in a variable while keeping its properties? I want to obtain exactly the same behavior even if I use $@ or my own variable in all possible situations. The attempts below didn't work: args=$@ args2="$@" # the arguments are…
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
6
votes
6 answers

How to stop Java from separating JSON string passed as a command line argument into separate subunits of args[]

I want to pass this JSON String to a Java class through command line arguments. {"body": "We should definitely meet up, man", "startDate": "2014-05-29 11:00:00", "endDate": "2014-05-29 12:00:00", "location": "Boca Raton", "subject": "This is the…
Ben Sandler
  • 2,223
  • 5
  • 26
  • 36
5
votes
6 answers

Why don't we get an error when we don't pass any command line arguments?

We can give parameter args[] to the main() method or choose not to. But if we would call any other parameterized method without passing enough arguments, it would give us an error. Why it is not the case with the main(String[] args) method?
shalini satre
  • 53
  • 1
  • 5
5
votes
1 answer

In a Windows dockerfile, how can I pass an ARG value to a RUN command?

I cannot find any syntax that works. Even suggested solutions on stackoverflow do not work. Running them shows blank output where values are expected. ENV variables are not persisted in the built image (i.e. running 'set' from the command line in…
Triynko
  • 18,766
  • 21
  • 107
  • 173
5
votes
1 answer

Method takes 1 positional argument but 2 were given

I'm running a celery task, which needs two arguments, like so: @task_bp.route('/analysis/', methods=['GET', 'POST']) def save_user_with_analysis(user_id): post_data = request.get_json() response_object = { 'status':…
8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198
5
votes
1 answer

How does the python script know itself running in nohup mode?

I'm thinking if my run.py script can act in two different mode. when in nohup mode: nohup python run.py & ,act like full log output mode.but in normal mode python run.py, act like log suppressed mode. So it will be tidy and clear for the user. So.My…
5
votes
2 answers

python args not working unless it has a position reference

def test_stats(team, *args): if not args: [do some stuff] else: team_fixtures = (Fixtures.objects.filter(home_team=team_details.id) |…
purchas
  • 349
  • 7
  • 19
1 2
3
59 60