Interesting, my thoughts: a) while --switch:value works, it requires an extra ":" char, so, maybe an option for allowing it to work as --switch[space_char]value;
b) in unit VSoft.CommandLine.Parser.pas@line 181, there's a condition: if not FileExists(value) then it's not clear to me if that's the wanted effect, but what if the "value" file name is a file to be created by the console/gui application?
Dorin Duminica 1) pull requests are invited. As I said, I covered off my immediate needs, but it's pretty easy to extend. b) The IsOptionFile property of the optiondef defines that option as a file which contains other options. It's intended to work around windows command line length limits (1024 chars I think).
Jeroen Wiert Pluimers You are thinking of SysUtils.FindCmdLineSwitch - which work but it's not extensible and you still end up writing a lot of code around it.
Interesting, my thoughts:
ReplyDeletea) while --switch:value works, it requires an extra ":" char, so, maybe an option for allowing it to work as --switch[space_char]value;
b) in unit VSoft.CommandLine.Parser.pas@line 181, there's a condition:
if not FileExists(value) then
it's not clear to me if that's the wanted effect, but what if the "value" file name is a file to be created by the console/gui application?
There is a similar concept in the RTL somewhere. Not sure if it is generics based though. Need to check out when back home.
ReplyDeleteDorin Duminica 1) pull requests are invited. As I said, I covered off my immediate needs, but it's pretty easy to extend. b) The IsOptionFile property of the optiondef defines that option as a file which contains other options. It's intended to work around windows command line length limits (1024 chars I think).
ReplyDeleteJeroen Wiert Pluimers You are thinking of SysUtils.FindCmdLineSwitch - which work but it's not extensible and you still end up writing a lot of code around it.
ReplyDeleteVincent Parrett it's a different one, maybe not even RTL. Will try and check when near a Delphi VM.
ReplyDelete