5,058 questions
0
votes
1
answer
82
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
100
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\...
12
votes
4
answers
671
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
137
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
90
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
74
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
110
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.
...
0
votes
0
answers
43
views
How to open additional files in existing OpenSCAD instance
In case it matters, I'm running 2025.06.25 of OpenSCAD. If I have an instance of OpenSCAD running I can open additional source files such as libraries in the same instance using the menu system. Such ...
5
votes
1
answer
215
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
86
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
95
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 ...
2
votes
1
answer
67
views
bash: -- being caught by first option, rather than by -- case
I have a script that parses command line arguments after using getopt. The issue is that the -- before my positional arguments is caught by my --usage) case, thus showing usage text erroneously. Is ...
0
votes
1
answer
86
views
Ansible WebSphere Liberty Install Failing
My Ansible task to install Liberty on an AIX server worked as expected and then when I tried another version it just fails now. It's possible that I am not seeing the actual cause of my issue but ...
0
votes
1
answer
107
views
How to implement logic to process dynamic command-line arguments with Spring Shell?
I'm working on a Spring Shell-based application where I need to process dynamic command-line arguments. I have implemented logic for a specific format, but I’m encountering issues when the order and ...
0
votes
1
answer
352
views
Implementing --interactive with System.CommandLine
I have a System.CommandLine .NET 9 command line application. It's mostly used for scheduled tasks and the like, but sometimes users need to run it manually.
When run manually, while the help is good, ...
0
votes
0
answers
61
views
How can we pass long xml message as a command line argument in Java?
How can we pass long xml message as a command line argument in Java? I'm struggling to pass below xml message as a argument, actually I've developed a simulator to publish different xml messages to ...
1
vote
3
answers
139
views
Create a common CLI entry point in Python
First of all, I cannot share the original code so I apologize in advance if the example used does not make sense.
I also know the code I present has some issues and will not run as it is, but it is ...
0
votes
1
answer
29
views
How to find command line arguments of process when attached with Visual Studio's debugger?
After attaching to a process in the Visual Studio debugger, I want to find what this process's command line arguments are, how can I do that?
1
vote
0
answers
31
views
Passing Special Characters with a space in MSI command-line parameters Across Scenarios [duplicate]
I am using this setup.exe to install the application by passing MSI parameters directly to the MSI via the command line:
setup.exe/s /v"/l*V installer.log INSTALLDIR="""C:\Program ...
0
votes
0
answers
101
views
How to pass a space and a double quote together in MSI command-line parameters?
I am trying to install a desktop application through the command line. The application comes with an installer package, such as setup.exe, which was created using InstallShield.
I am using this setup....
2
votes
1
answer
342
views
How to inject the command line arguments to a Quarkus applicaiton
How to inject the command line arguments to a Quarkus applicaiton?
Normally we use Maven, Gradle or CLI to run a Quarkus application. But how can we inject command line arguments to the execution?
It ...
1
vote
1
answer
98
views
Powershell string array argument not working as intended when -File is used
I'm using a Powershell script that I found here: https://github.com/Simbiat/SnoozeGuard
The works by passing a string array and intended, when run in the usual way:
> C:\fullPathToSnoozeGuard.ps1 -...
0
votes
1
answer
205
views
Setting metaflow decorator using command line parameter
I have a metaflow flowspec with a decorator @some_decorator(parameter="something"). Is it possible to set things up so that I can set the parameter to the decorator via a command line ...
9
votes
1
answer
402
views
Is there a way to have a short and two long command line argument alternatives for a parameter?
I have guessed multiple syntax variations to achieve this in a single line in the MAIN function. I know I could achieve it in two separate lines, but am looking for the cleaner solution and only ...
0
votes
2
answers
279
views
Parsing command line arguments as an Array[String] in Scala 3?
Okay, so I've been trying to learn Scala from a textbook, but it was written before Scala 3 was released so a lot of the example code doesn't compile.
Here's how the book introduces command line ...
1
vote
0
answers
73
views
F# Argu, how to merge multiple arguments?
Argu is a great library to read program arguments in F#.
But in case of modularization, is it possible somehow to merge different arguments without subcommands? Let's say you have a bunch of command ...
0
votes
1
answer
2k
views
How to read command line arguments in Zig?
How to get access to command line arguments with Zig code?
When starting program like this:
$ path/my-program foo bar
I'd like to get strings path/my-program, foo and bar in my code. Either as c-...
0
votes
1
answer
148
views
Unable to use parameters value from command line to Quarto file while rendering Quarto document in python
I am trying to pass parameter value using quarto CLI and use it in Quarto file with Python code but it's not working.
Command used:
quarto render test.qmd -P foo:5 --output test_cmd_out.html
Quarto ...
1
vote
0
answers
60
views
VS Code doesn't pass arguments in Flutter?
Regarding to
I have created a configuration in launch.json
{
"name": "my_upp (debug mode command-line)",
"cwd": "my_upp",
...
1
vote
2
answers
237
views
How to pass a json as a string argument in python code with use of argsparse and Powershell? [duplicate]
I've been wrapping my head around this problem and can't find a solution.
I have a pretty simple code:
import argparse
import json
def main():
parser = argparse.ArgumentParser(description="...
0
votes
1
answer
54
views
What's the difference between `-` and `--` in shell commands
What is the difference between using - and -- in shell commands?
I've seen commands like this:
pip install -U library
and:
npm i --someOption package
Is there a difference. Are they just that -- is a ...
1
vote
2
answers
54
views
extended help based on argument groups using Python's argparser module
Consider the following toy example:
cat extended_help.py
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("-H", "--help-all", action = "version",
...
2
votes
0
answers
88
views
`getopt` with atoi causes segmentation fault
#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#define PORT 12344
int main(int argc, char** argv) {
int opt;
int server_fd, client_fd, epoll_fd;
int ...
1
vote
0
answers
26
views
How to get CLI arguments in Assembly language without libc? [duplicate]
I wanted to print out first command line argument in x86_64 Assembly on Linux, but I have had hard time getting value of it. For clarification: commands I use to compile this are as -o args.o args.s -...
0
votes
1
answer
64
views
Check if ArgParse optional argument is set, default value supplied
I'm trying to check if an optional argument is supplied by the user but I want to set its default value if it is not supplied. If I try to use if statement by exploiting None, the default in help ...
0
votes
1
answer
265
views
How do I de-obfuscate this PowerShell command
Long time reader, first time poster.
I recently read an article on command line obfuscation and I need an adult to explain to me Barney style how does
( [sTrING]::JOIn(”
,(’39s33-43%114y56F116j114%...
2
votes
0
answers
297
views
Java ProcessBuilder replaces Unicode characters in commands by '?'. How can I avoid that?
I have a Java importer application that is executed via a scheduler (also from me) by usage of ProcessBuilder. The scheduler passes a file path to the started application as an argument in the process ...
0
votes
1
answer
197
views
Start a packaged Windows app on system start with minimized or hidden window
I have developed a packaged desktop Windows App SDK app that has the option run on system startup using StartupTask. This works well, but now I also want the option to start with the window in the ...
0
votes
2
answers
224
views
How to echo command line arguments when debugging in VSCode?
I am debugging my code using a launch.json file. I have a long list of command line arguments:
"args": [
"-i", "inputfile",
&...
1
vote
1
answer
157
views
Boost::program_options "option cannot be specified more than once" error when implementing a program with multiple modes
I am attempting to create a program with the following command line usage:
test_program [General Options] <mode_1_option_1> <required_option_1>
OR
test_program [General Options] --toggle-...
1
vote
0
answers
21
views
Python adds ending quote to PS auto-completed space-containing directory names [duplicate]
I am passing am trying to pass directories-with-spaces as arguments on windows 11, and using PS autocomplete (TAB) to provide the full name. The '.\a b\' gets naturally completed through powershell, ...
-1
votes
1
answer
226
views
Parsing command line args that can contain spaces
I am building a spring boot based command line utility written in java for teams in my organization. I will have to allow teams to pass arbitrary command line args that can contain spaces.
I tried ...
1
vote
0
answers
46
views
Why does Start-Process Powershell -Command .... length limit change with -Credential?
Powershell has Start-Process cmdlet (start a new process) which can be a new powershell and get it to run whatever e.g. via -Command & {scriptblock} .
Limitation on/after ‘-Command ‘ of 32,760 ...
0
votes
1
answer
84
views
setup function in class doesn't work as expected while passing parameterized values
I have no idea why modifying the code mentioned here to the following doesn't work? The variables are not accessible inside the tests and setup is being invoked before every test despite the scope ...
0
votes
1
answer
66
views
Shell how to pass only some user input to script?
If I have a very simple shell script like this:
echo "thing 1?"
read input1
echo $input1
echo "thing 2?"
read input2
echo $input2
How can I call the script/command with only 1 of ...
1
vote
4
answers
398
views
How to properly escape single quotes in filenames?
I have files with single quotes in their name, say o'a. I want to process them in awk (gawk-5.3.0):
(fd is an alternative to find).
Please don't tell me about fd -x option, my command is snippet of a ...
0
votes
1
answer
115
views
Is it possible to get the exact script invocation in Python?
I would like my python script to produce a text file containing the exact command line the user entered to invoke the script. In the past, I have done the following in bash:
echo "$0" "$...
1
vote
1
answer
70
views
Change command which works in cmd.exe to work in powershell.exe
I have a command which works without issue in cmd.exe:
%TESTING_INSTALLATION_PATH%\\client\\batch.exe --log-level=error --run %CI_BUILDS_DIR%\\autotest\\jobs\\clear.py
But it doesn't work in ...
0
votes
1
answer
91
views
Unnecessary terminals opening when using .bat script
I want to use terminal script to open both of my working folders using VS code at once. I'm currently using this
@echo off
start code "path to folder 1"
start code "path to folder 2&...
0
votes
1
answer
47
views
Passing a string argument to bash causes syntax error
I am trying to run a bash script for rescaling fMRI data using AFNI's 3dcalc.
One of the arguments for this function is "expr" which will "Apply the expression - within quotes - to the ...