Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tokibito/delphi-argparse
Command line argument parser for Delphi.
https://github.com/tokibito/delphi-argparse
delphi pascal
Last synced: about 1 month ago
JSON representation
Command line argument parser for Delphi.
- Host: GitHub
- URL: https://github.com/tokibito/delphi-argparse
- Owner: tokibito
- License: mit
- Created: 2013-03-02T15:25:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T16:25:26.000Z (about 6 years ago)
- Last Synced: 2024-01-09T01:14:55.828Z (5 months ago)
- Topics: delphi, pascal
- Language: Pascal
- Size: 72.3 KB
- Stars: 41
- Watchers: 8
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Lists
- awesome-pascal - Nullpobug.ArgumentParser - line parser for Delphi and Free Pascal (Command-line)
README
========================
Nullpobug.ArgumentParser
========================Command line argument parser for Delphi.
Requirements
============* Delphi 2007 or FPC
License
=======* MIT License
Usage
=====::
var
Parser: TArgumentParser;
ParseResult: TParseResult;
begin
Parser := TArgumentParser.Create;
Parser.AddArgument('--foo', saBool); // --foo
Parser.AddArgument('--bar', saStore); // --bar bar_value
ParseResult := Parser.ParseArgs; // if omitted, ParamStr is used.
// ParseResult := Parser.ParseArgs(ListOfString);
ParseResult.HasArgument('foo'); // It returns Boolean.
ParseResult.GetValue('bar'); // It returns String.
end;Example
-------Example codes are in "Example" directory.
::
>cd delphi-argparse\Example
>make win32
>ArgumentParserExample.exe --foo -b 123 abc def
foo: True
bar: 123
arg1 :abc
arg2 :def