Giter Club home page Giter Club logo

vsoft.commandlineparser's Introduction

vsoft.commandlineparser's People

Contributors

lmbelo avatar luebbe avatar sglienke avatar staticcat avatar vincentparrett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsoft.commandlineparser's Issues

PrintUsage crashes with ERangeError when no description is given

When looking into #16 I found out that PrintUsage crashes when the description is empty

                   if opt.HasValue then
                      s := s + FNameValueSeparator + '<' + opt.LongName + '>';
                    if opt.AllowMultiple then
                      s := s + ' +'
                    else
                      s := s + '  ';
                    s := PadRight(s, FDescriptionTab);
-->                 s := s + descStrings[0];  <-- Exception occurs here
                    proc(s);
                    numDescStrings := Length(descStrings);
                    if numDescStrings > 1 then
                    begin
                      for i := 1 to numDescStrings -1 do
                      begin
                        s := PadLeft(descStrings[i], FDescriptionTab);
                        proc(s);
                      end;
                      proc('');
                    end;

StrToFloat is locale specific

In VSoft.CommandLine.OptionDef.pas, under tkFloat: in TOptionDefinition<T>.Invoke, StrToFloat is called, but StrToFloat is locale specific.

This means that on most European machines, StrToFloat will assume ',' as a decimal separator and not '.'. That might not work well for scripts that use a program using this command line parser.

Now, I cannot find a simple method like Str (which for the reverse case always uses '.' as decimal separator, whereas FloatToStr would always use the locale), so you need to supply a TFormatSettings with DecimalSeparator set to '.' as its second argument.

Need option sets

I just had a need to be able to register sets of options, which are context sensitive based on another option, e.g

mytool commandA [command A options]
mytool commandB [command B options]

Open to suggestions on how to implement this.

Wrong option help index

In the master branch in vsoft.commandline.options.pas at line 348 the check if numDescStrings > 1 is probably wrong and the first option help text is never displayed in print usage.

Changing the check with if numDescStrings > 0 correctly works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.