Web lists-archives.com

Re: regtool 2.11.1 need a way to specify leading "-" in values

On 1/22/19 5:12 PM, Gordon Grimes wrote:
> I believe there is no way to specify values with leading "-" in regtool.  I expect the same applies to keys.  An "end of switch processing" switch would be useful, forcing 'regtool' to interpret all remaining arguments literally.

Fortunately, you are mistaken.  regtool uses getopt_long(), and
therefore, like all other programs that use this, automatically inherits
the POSIX rule that '--' is the marker for "end of switch processing".

> Example:
> % regtool -s set '\HKCU\Environment\MAVEN_OPTS' "-Xms512m -Xmx3072m  -Dcom.sun.management.jmxremote"
> regtool: unknown option -- X
> Try `regtool --help' for more information.


regtool -s set '\HKCU\Environment\MAVEN_OPS' -- "-Xms512m -Xmx3072m

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature