#1 2023-04-19 12:16:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,700
Website

New Command Line Parser in mORMot 2

For most projects, we want to be able to pass some custom values when starting it.
The command line is then used to add this additional information.

We have ParamStr and ParamCount global functions, enough to retrieve the information. You may also use FindCmdLineSwitch for something more easy to work with.
The Lazarus RTL offers some additional methods like hasOption or getOptionValue or checkOptions in its TCustomApplication class. Their are better, but not so easy to use, and not available on Delphi.

We just committed a new command line parser to our Open Source mORMot 2 framework, which works on both Delphi and FPC, follows both Windows and POSIX/Linux conventions, and has much more features (like automated generation of the help message), in an innovative and easy workflow.

This is the forum discussion thread for the following blog article:
https://blog.synopse.info/?post/2023/04 … n-mORMot-2
big_smile

Offline

#2 2023-04-20 00:49:29

zhangguichao
Member
Registered: 2023-03-21
Posts: 29

Re: New Command Line Parser in mORMot 2

great job! thanks~

Offline

#3 2023-04-20 07:57:20

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: New Command Line Parser in mORMot 2

Great job!! Thank you!
We need a blog of your "Angel" implementation and the Letsencrypt status too

Offline

#4 2023-04-20 08:00:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,700
Website

Re: New Command Line Parser in mORMot 2

@dcoun
AFAIK both AGL and Let'sEncrypt features are used on production on diverse sites.
But there is indeed still to write about.
wink

Offline

#5 2023-05-02 13:26:58

flydev
Member
From: France
Registered: 2020-11-27
Posts: 73
Website

Re: New Command Line Parser in mORMot 2

Hi @ab,

Replying here about the issue #183 reported on Github - your commit (38f27f08) fixed the / or - exception.

(Sorry for the time lost about the PR, I feel learning more by doing mistake and trying to fix things, to be honest, I had a doubt it was the right correction as you confirmed it on the PR comment that is making sense, lesson learned smile)

Offline

#6 2023-05-02 19:10:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,700
Website

Re: New Command Line Parser in mORMot 2

Don't be sorry - your remark was correct, and there was indeed a problem with / or - values as parameters.

For the PR, you loose more time than me for sure.
But I am sure the next time we will first discuss here then you will make a perfect PR!

smile

Offline

Board footer

Powered by FluxBB