5,056
questions
1
vote
1
answer
67
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
65
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
19
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
66
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
32
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
176
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 ...
-2
votes
1
answer
53
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
54
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
71
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
0
answers
33
views
Start Chrome with device emulation (iPhone 12 Pro) from a script in Windows
I use Google Chrome with Internet to run automated tests and I would like to know if there is a way to launch Chrome in emulation mode.
For example:
I tried a workaround with the --emulation-mode=&...
0
votes
1
answer
38
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 ...
0
votes
0
answers
23
views
Windows 10 SendTo selected files passed as parameters will not work if they contain commas but no spaces
This is a SendTo-specific issue related to how Windows Explorer passes the multiple selection file paths to the handling cmd script.
Since Windows Explorer establishes the convention for how multiple ...
0
votes
0
answers
13
views
Command Line for opening RTC Eclipse Client 6.0.2 with a specific username and password file
My command line for opening RTC Eclipse Client is:
"C:\Program Files\IBM\TeamConcert\eclipse.exe" -product com.ibm.team.concert.product
Can I add anything on the end of the command line to ...
0
votes
1
answer
110
views
How can I run a batch file with command line arguments using AutoIT
webui.bat --use-zluda --debug --autolaunch
I want to run this batch file (webui.bat) with these command line arguments (--use-zluda --debug --autolaunch).
The batch file is located at 'F:\automatic\...
0
votes
0
answers
33
views
Why does passing bearer token to a shell script not work but embedding the value does [duplicate]
I have a shell script foo.sh
curl -i -X GET 'https://example.com/bar' \
-H '...
2
votes
1
answer
52
views
Can't save names in typedef instances
I'm trying to create a voting project in c where you get the candidates names in command line and then the voters number and votes. The function bool vote(char name[]) counts the votess and the void ...
0
votes
2
answers
95
views
How to define separator characters for argparse?
Python's argparse module is a powerful tool for parsing script command line arguments. The problem is that it expects the args to be separated by spaces. Is there a way to let argparse know I am using ...
0
votes
0
answers
39
views
Supress screen sharing selection window by always selecting Entire screen with audio in edgewebview2
chrome when i run it with --auto-select-desktop-capture-source="Entire Screen" does audio share as well but edgewebview2 doesn't why?, In chrome I can turn it off by --screen-capture-audio-...
0
votes
0
answers
77
views
How to read with path completion on a command line application in Zig?
I'm trying to read the path for a file with std.io.getStdIn, but there is no path completion.
Here's how I'm doing:
const input = try io.getStdIn().reader().readUntilDelimiterAlloc(allocator, '\n', ...
0
votes
0
answers
41
views
Install packages with text file in command line Conda error: OSError [Errno 2] No such file or directory
I am trying to run a friend's code on Jupyter notebooks in a remote server, and he provided a text file with over 200 packages and the correct version numbers to install to ensure consistent output. I ...
0
votes
1
answer
40
views
Calling Matlab function from command line in Python Problem
In my project I have a .m file whose name is SHROku.m with SHROku() function. When I call this function from Python like below command I successfully run the program.
subprocess.run(r"C:\Program ...
0
votes
0
answers
40
views
How to print to an Internet printer using Ghostscript silently via Command Prompt
I am using Windows Server 2022 Std.
I need to print pdf labels silently to an internet based printer. I have the following command to call Ghostscript but it prompts which printer to select, even ...
1
vote
1
answer
90
views
How to get command line arguments in Fortran
I know how to get simple command line arguments in Fortran using the function GET_COMMAND_ARGUMENT() like this:
program silly_app
character(len=10) :: arg
integer :: i, x
...
0
votes
0
answers
19
views
Create a bash script with multiple arguments using getopts [duplicate]
I want to create a bash script that accepts some arguments and has the following usage:
$ ./execute.sh add person --id 123 --name John
I found getopts and was trying to use it to parse the options ...
-1
votes
1
answer
47
views
space in a command line argument in java [closed]
When the sentences written under single quote is added as one argument in java?
like - 'i am a good boy'
this is also java is considering as single argument
like " i am a good boy"
so is it &...
0
votes
1
answer
43
views
Running R Script at command line with commandArgs value in tidy evaluation in R programming
I have a r script, named myrsciprt.R as follows:
library(ggplot2)
library(ggpubr)
library(palmerpenguins)
create_plots_pdf <- function(output_filename, group_name){
# Histogram example: ...
0
votes
0
answers
31
views
PyCharm: "Run File in Python Console" not producing any output for a program with command line arguments
The program I am running runs fine when just doing a standard run or debug, but when I try "Run File in Python Console" On pyCharm profressional, no output is given at all. If I do "...
0
votes
2
answers
57
views
How to reuse switch block labels without goto?
How to implement the following code without goto and unnecessary code complexity?
namespace Test
{
static class Program
{
bool keyA = false;
bool keyB = false;
// ...
...
0
votes
1
answer
51
views
What is the parameter name for the pdf file name I pass to ghost script?
I can print a file using Ghostscript via the command prompt using the below command:
"C:\Program Files\gs\gs10.03.0\bin\gswin64c.exe" -q -dNOPAUSE -dBATCH -sDEVICE=mswinpr2 -sOutputFile=&...
1
vote
1
answer
25
views
Spring-Boot: Command Line Argument for Deeply Nested Configuration Property
I have a Spring-Boot 3.1.6 application with a rather complex configuration object. In the application.yml there is this:
cfg:
array:
- ref-id: 123
name: special name
some-key:
...
0
votes
0
answers
50
views
How to determine the type of a command line argument in Clap?
I am using Clap (derive) v4.x for a Rust CLI application. The basics, such as command line arguments, environment variable values, and default values, are working properly. However, I need to ...
0
votes
1
answer
47
views
Create bash script that calls a python script which takes in positional arguments, named arguments and flags
I would like to create a bash-script that calls a python script. The python script accepts both positional arguments, named arguments and boolean flags. The idea is that the bash script passes ...
0
votes
1
answer
169
views
Create custom command line parameters for C# console application
I have a C# console application that I'm gonna run from the command line, and it should take some information as input and serialize the given values into a json file, but the classic args[] is not ...
2
votes
0
answers
90
views
How to create short and long versions of gflag flags for command line in CPP?
For example, I'd like to be able to instead of just:
DEFINE_bool(verbose, false, "Run in verbose mode");
which gives me the ability to run ./program --verbose, be able to run --verbose or -...
1
vote
1
answer
41
views
Passing arguments to ENTRYPOINT causes the container to start and run indefinitely
Here's the docker-compose.yml file:
version: "3"
services:
db_cassandra:
container_name: db_cassandra
image: cassandra:latest
volumes:
- "./common/cassandra:/lua/...
0
votes
2
answers
166
views
Is there a way to pass Today's date as a command line argument to Excel from a Windows Task Scheduler Job
We have have a Windows Task Scheduler job that runs an Excel xlsm file with some command line arguments as below:
Program/script:
"C:\Program Files (x86)\Microsoft Office\Office15\EXCEL....
-2
votes
1
answer
93
views
Python : Argparse take default value from json file if not passed in command line
I have a script with command-line arguments that I need to modify. I want to make -x, -s, and -e mandatory, while -m should be optional. If -m is not passed, it should take the value from a JSON file. ...
0
votes
1
answer
161
views
Can input arguments be passed to an httpyac file?
I am looking to pass an input argument from the command line to an httpyac file. Specifically, I want to call the httpyac file in such a way that I can pass the id argument and access it within the ...
0
votes
0
answers
55
views
How do I get the atoi function to work in Assembly?
I am trying to get this assembly program to print out an error message when the second argument on the command line is less than 0 or larger than 12. However when using it for some reason I always get ...
0
votes
1
answer
103
views
Write a shell script or Python code with default arguments for git-filter-repo
Sometimes, I need to change the author/committer email and name (assume author=committer always) for all commits in a repository. I need to do this once for repo, but I may need to do it for multiple ...
0
votes
0
answers
27
views
how to add Azure ci/cd pipeline script in yml file to run integration tests based on a command line flag - "test",
how to add Azure ci/cd pipeline script in yml file to run integration tests based on a command line flag - "test"
0
votes
0
answers
77
views
Zero argument count in main()? [duplicate]
I want to design an application that will run as GUI (wxWidgets) if there are zero arguments or parameters passed to main(). I can't get rid of command line (console) feature because the application ...
1
vote
0
answers
55
views
Sqlcmd: The -W and the -y/-Y options are mutually exclusive
I am working on SQL server task. I need a sqlcmd result file with complete records with headers.
Here is the command and error message below
sqlcmd -S [Server_Name] -U [User_Name] -P [Password] -d [...
3
votes
1
answer
86
views
Win64 NASM: Segfault in CommandLineArgvW
Any attempt to call CommandLineToArgvW in NASM using standard Windows calling convention results in it always segfaulting. The equivalent of this program in C works perfectly fine
NASM source code:
...
0
votes
0
answers
276
views
How to use boolean flag with cxxopts and command line?
I defined:
options.add_options()
("m, monitor", "Monitor current state", cxxopts::value<bool>()->default_value("true"));
How do I use flag m in command line ...
0
votes
3
answers
57
views
How do I get an indeterminate number of command line arguments in a bash script?
I am writing a bash script to be run on macOS Sonoma
$bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.
My script is to read ...
1
vote
0
answers
140
views
Par::Packer packaged scripts lose the ability to parse UTF-8 arguments from the command line
The answer provided in "Handling wide char values returned by Win32::API" can parse UTF-8 command line arguments on windows.
But with Par Packer packaging, the parsing failed.
If I save this ...
0
votes
0
answers
27
views
How to use commandLine argument from conftest file to other file if we have already import that file in conftest
We have pytest framework structure given below
In this framework, we have set up command line argument in conftest file
Problem:
We need to access '--ENV' value in config.py file But we have already ...
-1
votes
1
answer
393
views
Chrome ignores command line parameters on Windows 10
When I run Google Chrome 120.0.6099.225 from the command line in Windows 10 22H2, e.g.
PS C:\Program Files\Google\Chrome\Application> .\chrome.exe --help
or
PS C:\Program Files\Google\Chrome\...