RTollison 0 Posted September 10, 2020 I am writing up a program to allow users to update/add to registry entries. the registry is for ABC_Auto_File and has different options not just open... I have it up and working but am curious of a better way to parse the info in the registry string. examples of the string in question are: "c:\my folder\myapp.exe" -c "c:\my folder2\myconfigfile" "%1" c:\folder\myapp -c c:\folder2\myconfigfile %1 c:\folder\myapp %1 the -C is there 99.99% of the time but sometimes users have it working without it. but i will be add it in when updating the registry. like wipe and rewrite. myapp is consistent but may include the .exe. current i am removing all the " and %1 the look for the -c anything prior is a string value i want and anything to the right is a sting value i want. i am currently using the copy/pos commands to get that info but am ALWAYS curious if someone has better option for parsing. Share this post Link to post
FredS 138 Posted September 10, 2020 See if this fits: Attribute-based Command Line Parsing Share this post Link to post
Lars Fosdal 1793 Posted September 11, 2020 https://larsfosdal.blog/2019/08/06/generic-command-line-parser-for-delphi-10-3-x/ Also, this thread contains numerous other parsers. Share this post Link to post
Vincent Parrett 763 Posted September 11, 2020 This is the command line parser we use in FinalBuilder and DUnitX and the package manager I'm working on. https://github.com/VSoftTechnologies/VSoft.CommandLineParser 1 Share this post Link to post