All Questions
Tagged with command-line-parsing or command-line-arguments
5,060 questions
4
votes
2
answers
187
views
Can I run a program so that it has no command-line arguments (not even the program's name)?
Can I arrange it so that my program's main() function gets exactly 0 arguments? That is, not even the program's name in argv[0]?
As an example, take the following program, which I would like to print ...
1
vote
0
answers
76
views
Inconsistency between cmd.exe and CommandLineToArgvW
In Windows (11 version 10.0.26200.7623, January 2026), there's an inconsistency between how cmd.exe constructs the command line for a tool it spawns, and how the API function CommandLineToArgvW() ...
4
votes
1
answer
130
views
(windows assemby) GetCommandLineA returns string with extra space after the executable name
In cmd, I wrote the following command to test an executable named "msl.exe":
msl test c.exe
The executable calls GetCommandLineA (from the Windows API) and prints the command line. However, ...
1
vote
0
answers
85
views
How to properly pass shellcode as a command line argument in Windbg using Python (pykd)
I'm using WinDbg and a python script along with the pykd plugin to send shell code to a basic C program in WinDbg.
Here is my python script:
import pykd
import sys
shellcode = "\x64\x8b\x12"...
0
votes
0
answers
39
views
PETSc-MUMPS Not Properly Responding To Command-Line Option
I have installed PETSc and MUMPS (MacOS 15.6.1, M2), and confirmed that they seem to work fine; i.e., I run the exceutable from the command line:
./mypetscapp
and it runs without issue.
However, ...
-1
votes
1
answer
92
views
Can I construct my own env::Args instance in Rust for testing purposes? [duplicate]
I'm writing a Rust program where I do manual command-line argument parsing. I skip the first argument since that's the executable and I don't care about that, then check the second argument for what ...
2
votes
1
answer
142
views
Launching a python script in vscode with arguments I get FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\USERNAME\\FolderName'
I am trying to debug python code in vscode using a launch config that asks for command line arguments.
My script is located here:
C:\Users\USERNAME\FolderName - With Spaces\_MyHome\Documents\Dev\...
11
votes
4
answers
797
views
How to correctly pass a filename with a single quote to ffmpeg's subtitles filter in Python?
I'm writing a Python script using subprocess to hardcode subtitles onto a video. My code builds a complex filter graph for ffmpeg's -vf argument, which includes burning in multiple layers of styled ...
1
vote
2
answers
220
views
System.CommandLine root command option handler fallback
I want to add a Option<bool> to the root command but still show the default output when the option is not provided.
RootCommand rootCommand = new RootCommand("My root command");
...
-1
votes
1
answer
93
views
What would be a suitable way to receive run-time arguments and combine them into an iterable object? [closed]
I'm struggling to get runtime arguments and combine them into a list. I'd like for run-time arguments to be like the following python main.py --all or python main.py --endpoint1 --endpoint2. I only ...
-1
votes
2
answers
83
views
Does ArgumentParser support different arguments per file, ffmpeg style?
I want my application to work on several files and have a different set of options for each input file:
python my.py -a file_a -b file_b --do-stuff=x file_c
ffmpeg uses this idea for its command line ...
0
votes
1
answer
115
views
What is wrong with my reading of command line arguments? [duplicate]
I am writing a program for working with functions and graphs, but that is beside the point. In my int main() I just look at the command line arguments, and then match them up to the expected result.
...
5
votes
1
answer
296
views
How does Rust's Command handle cmd.exe and batch script arguments?
A while ago there was a security advisory published for Rust that the standard library's Command API was not sufficiently handling arguments passed to cmd.exe and .bat files such that malicious ...
1
vote
1
answer
99
views
gcc OR clang command line invocation argument / parameter order precidence Last or First wins?
Search engines and reading the manuals are failing me. I'm not sure if there's a way to have E.G. gcc or clang output the final 'configuration' result of parsed command line arguments to check myself ...
-1
votes
1
answer
130
views
-r (--reuse-window) not working in code command at all
I used a new machine with VSCode for the 1st time. I moved my dev setup there, including EDITOR env var with code -wr. But I noticed e.g. git wasn't opening the file in the same window, unlike on old ...