when I execute the command :
sumo-launchd.py -vv-c /.../sumo-gui.exe
I receive error:
Usage: sumo-launchd.py (options)
sumo-launchd.py: error: no such option: --
sorry but I'm not very good with these installations
some help?
Most likely you wanted to use arguments -vv -c ... instead of -vv-c .... Many argument parsers treat a sequence of individual characters as multiple single-letter arguments (in your case: -v, -v, --, and -c), which is why the argument parser gives this weird error.
Related
I'm setting up jenkins freestyle job with bash script build step with ack command, Why I am not getting same result as from command bash on macOS?
Jenkins is set up on this macOS. I am using sck 2.28 version. I have tried to specify exact path to SCK declaration.
DEVVER=$\(/usr/local/Cellar/ack/2.28/bin/ack /path/to/file/app.config.ts -o --match '(?<=devVersion = ")(\d+\.)(\d+\.)(\d+)'\)
echo ${DEVVER}
Expected Output:
1.9.16
Actual Output:
/path/to/file/app.config.ts: line 1: export: `{': not a valid identifier
/path/to/file/app.config.ts: line 3: static: command not found
... (same for each line till 221;)
/path/to/file/app.config.ts: line 221: syntax error: unexpected end of file
As a workaround solution (not too good one) I have changed a command. Now I use grep -E "regex" in which I have removed ?<= and replaced spaces with . and cut the not matching characters in found line.
I am trying to figure out where a segmentation error is made. Thesame issue has been solved below for a different compiler. I am using CMake and am wondering if this compiler also has this function. CMake has no -g build option so I have no idea where to look.
Determine the line of code that causes a segmentation fault?
Here is also some info on what build options there are available for the debugger, maybe this points out what debugger I use since I have no idea.
/usr/bin/make: invalid option -- 'g'
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
--eval=STRING Evaluate STRING as a makefile statement.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from recipes.
-I DIRECTORY, --include-dir=DIRECTORY
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
-k, --keep-going Keep going when some targets can't be made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is below N.
-L, --check-symlink-times Use the latest mtime between symlinks and target.
-n, --just-print, --dry-run, --recon
Don't actually run any recipe; just print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't remake it.
-O[TYPE], --output-sync[=TYPE]
Synchronize output of parallel jobs by TYPE.
-p, --print-data-base Print make's internal database.
-q, --question Run no recipe; exit status says if up to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo recipes.
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
--trace Print tracing information.
-v, --version Print the version number of make and exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is referenced.
This program built for x86_64-pc-linux-gnu
Report bugs to <bug-make#gnu.org>
I want to parse command line options with arguments in OCaml.
The module Arg of the standard library seems to do everything I need and there are some tutorials which explain how to use this module.
My problem is, that they all seem to share the same strange behavior when the argument of an option is missing. For example, executing the program from this example with ./a.out -d produces the following output:
./a.out: option '-d' needs an argument.
usage: ./a.out [-b] [-s string] [-d int]
-b : set somebool to true
-s : what follows -s sets some string
-d : some int parameter
-help Display this list of options
--help Display this list of options
./a.out: ./a.out: option '-d' needs an argument.
usage: ./a.out [-b] [-s string] [-d int]
-b : set somebool to true
-s : what follows -s sets some string
-d : some int parameter
-help Display this list of options
--help Display this list of options
.
usage: ./a.out [-b] [-s string] [-d int]
-b : set somebool to true
-s : what follows -s sets some string
-d : some int parameter
-help Display this list of options
--help Display this list of options
I was not able to find out why the error/usage message is printed three times. This also happens to all the other code examples I found online. Is this a problem in the Arg module or is it somehow not used correctly in these examples?
I have managed to reproduce the bug with OCaml 4.04.2, but not with 4.02.3, so it would seem that there is some sort of regression going on there.
So, one thing you could do is sticking to an older version of OCaml, but I wouldn't recommend that.
Instead, you could use an alternative standard library, such as Jane Street's Core. It has a module named Command which allows you to write command-line interfaces just like the one you're trying to run.
An extensive tutorial for this module is available here.
As an example, here is the CLI from Rosetta using Command:
open Core
let spec =
let open Command.Spec in
empty
+> flag "-b" (no_arg) ~doc:"Sets some flag"
+> flag "-s" (optional_with_default "" string) ~doc:"STRING Some string parameter"
+> flag "-d" (optional_with_default 0 int) ~doc:"INTEGER Some int parameter"
let command =
Command.basic
~summary:"My awesome CLI"
spec
(fun some_flag some_string some_int () ->
printf " %b '%s' %d\n" some_flag some_string some_int
)
let () =
Command.run command
EDIT : This bug was known and is going to be fixed in OCaml 4.05.
I'm trying to use a demangler with the llvm-cov report tool. The following is the command I'm running:
llvm-cov report /path/to/executable -instr-profile /path/to/default.profdata /path/to/src/ -Xdemangler c++filt -Xdemangler -n
I've tried rearranging the options and have tried using "-Xdemangler=c++filt -Xdemangler=-n" instead, and also using --no-strip-underscore instead of -n. It does not complain about the demangler, whereas if I make an obvious error with the command syntax it does tell me, but the output is not demangled.
From the llvm-cov documentation:
-Xdemangler=< TOOL >|< TOOL-OPTION >
Specify a symbol demangler. This can be used to make reports more human-readable. This option can be specified multiple times to supply arguments to the demangler (e.g -Xdemangler c++filt -Xdemangler -n for C++). The demangler is expected to read a newline-separated list of symbols from stdin and write a newline-separated list of the same length to stdout.
I've used the following to ensure that c++filt works, and it does:
c++filt -n _ZN4core6ZipperC2ENSt3__110shared_ptrIN8core_gen14PlatformZipperEEE
Output:
core::Zipper::Zipper(std::__1::shared_ptr<core_gen::PlatformZipper>)
I have to use the -n option, or it will not demangle, but I'm at a loss for why llvm-cov does not seem to be using it correctly.
I've also tried using a shell script to try to capture the input llvm-cov gives to the demangler and write it to a file before invoking c++filt, but the file was empty when I looked after running the command.
Am I doing something wrong?
It appears use of demangled function names is not hooked in everywhere in llvm-cov.
This report (the -name-regex option is needed to produce function names) does respond to the -Xdemangler option:
llvm-cov report /path/to/exe -name-regex=\.* -instr-profile=default.profdata -Xdemangler=c++filt
I see it's fixed in https://reviews.llvm.org/rL294136
I'm writing a utility that accepts a secondary shell command as its final parameter. My utility then runs the supplied shell command on behalf of the user. The user will invoke it as follows:
util [options] command with args
I want QCommandLineParser to parse the initial options, then leave the tail-end stuff alone (or parse it into a pure value list). Instead, QCommandLineParser complains that the user has entered invalid arguments.
For example, if the user were to enter
util -r ls -l
then ls -l is a valid command that I want to accept but Qt tells the user that -l is an invalid argument for my application. What's the best way to deal with this?