Questions tagged [cmdline-args]

38 questions
17
votes
3 answers

How to pass command line arguments to Deno?

I have a Deno app, that I wish to pass some command line args to. I searched the manual, but found nothing. I tried to use the same commands used in Node.js, assuming they might be sharing some for the std libraries, but it didn't work as well. var…
Ahmed Hammad
  • 2,798
  • 4
  • 18
  • 35
17
votes
2 answers

Passing arguments to C++ programme for debugging in VSCode

I want to debug a C++ project in VSCode (on a Mac, using either GDB or LLDB). The program itself takes command line arguments like ./prog -input cf file_x.txt This works fine when starting a debugging session in GDB on the command line. In VSCode,…
cszang
  • 198
  • 1
  • 1
  • 7
9
votes
1 answer

Detect whether macOS app was launched from the command line (Terminal)

I have a GUI macOS app that may also be launched from Terminal, with optional command line arguments. When launched with arguments, I like to run the app in a "cmdline" mode where I do not display any UI but instead communicate via stdin + stdout…
Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149
3
votes
2 answers

Lua cmd-line string

Say I call Lua with this cmd: luajit neuralnetwork.lua --satEpoch "somestring" --maxEpoch 50 How can I access this same cmd-line string from Lua? I know about the arg table, but it removes all quotes from the original command string making it…
Nicholas Leonard
  • 2,566
  • 4
  • 28
  • 32
2
votes
0 answers

Read command line arguments in assembly

I'm writing an assembly program in NASM and as part of it I wanna be able to read command line arguments, which in my case could me one of two things, a debug message "-d", or a number represented in Hex, so for example: `./programName AF -d` The…
giorgioh
  • 377
  • 1
  • 13
2
votes
1 answer

Why is it allowed to modify argv[0]?

I have been working on a project that uses PIDs, /proc and command line analysis to validate processes on a system. My code had to be checked by the security guys who manage to break it with a single line... embarrassing! #!/usr/bin/env perl $0="I…
urban
  • 5,392
  • 3
  • 19
  • 45
1
vote
0 answers

passing a glob pattern as args in vscode linux python run configuration

in VScode on linux, when I need to set an argument for the python executable my_scipt.py that I am working on, and this arg is supposed to be a glob pattern like some/where/like_*, I suspect it could be done by passing this arg in the jscript…
qbit
  • 25
  • 3
1
vote
2 answers

Postgres How to import CSV ignoring a column id is bigserial

I have a CSV which contains column names and data, but does not have the column ID. When I import my data via this command line: type "..\MyCSVtoImport.csv" | "..\psql.exe" -h MyServerPostgres -p 5432 -U "MyUser" -c " COPY mytable FROM STDIN…
SebP
  • 13
  • 2
1
vote
1 answer

Creating new Object from args given through cmd line gives me OutOfMemoryError thrown from UncaughtExceptionhandler

I cannot find out why the above error thrown. It works fine when I only enter 2 arguments (e.G 22.5 km), using more than that (20.5 km 400 ft) gives the error. Here is the code: if (args.length > 0) { for (int i = 0; i <…
sonti yo
  • 61
  • 1
  • 9
1
vote
1 answer

Use whitespace in Windows command line parameters

My AutoIt script : WinWaitActive("Open") Send($CmdLine[1]) Send("{ENTER}") I execute it from Java (passing a filepath to it): String autoITExecutable = "C:\\filechooser.exe " + fileSource; Name of file contains spaces, so it reads filename up to…
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
1
vote
0 answers

Does /proc/cmdline contain spaces after "="?

I have written a script to read a parameter from cmdline. Ex. TARGET=X86. Here My question is, can somebody give space after/before "="? because in my test application i am searching the entire string "TARGET=X86". Is there any rule for writing…
Akaash
  • 61
  • 1
  • 8
1
vote
1 answer

Linux console changed, print OK, read NOK

I'm working on a small embedded linux platform at the office where I have to change the default console from ttyS0 to another ttySx. The ttyS0 is enabled and is the default console. I enabled the other ttyS, successfully probed it, I've given it…
mdaniel
  • 191
  • 1
  • 12
0
votes
1 answer

Is it possible to disable code paths with command line arguments in C++?

I have a debug drawing flag in my game project. This flag determines whether Box2d's DebugDraw is drawing before the end of each frame. Is it possible to use something like: #ifdef 'debug drawing flag' //do debug…
Ian
  • 65
  • 1
  • 8
0
votes
1 answer

How can I extract only executable path and args from cmdline in linux?

I am writing a python application, which uses Popen to start other exectutables. I then use Psutil to collect information about them. One of the things I need is the exact CMD I used to start the application. For example: >>> p = psutil.Popen( …
Slav
  • 147
  • 2
  • 13
0
votes
1 answer

Azure Devops steps.script vs CmdLine@2/ Bash@3

steps.script purpose is NOT clear. It allows only Inline Scripts to be executed? I actually want to use file with steps.script instead of inline script. Cannot i use CmdLine@2 on windows or Bash@3 on linux/Unix Instead of steps.script. Link for…
ABC DEF
  • 189
  • 2
  • 14
1
2 3