I am using the Crayon Code Highlighter. Let’s see how it works:
procedure ConfigureOptions;
var
Option : IOptionDefintion;
begin
Option := TOptionsRegistry.RegisterUnNamedOption('The file to be processed',
procedure(value : string)
begin
TSampleOptions.FileToProcess:= value;
end);
Option.Required := true;
Option := TOptionsRegistry.RegisterOption('OutputInUpperCase','o', 'The output should be in upper case',
procedure(value : Boolean)
begin
TSampleOptions.OutputInUpperCase:= value;
end);
Option.Required := true; Option.HasValue := False;
Option := TOptionsRegistry.RegisterOption('NumberOfIterations','n','The number of times the file should be processed',
procedure(value : integer)
begin
TSampleOptions.NumberofIterations := value;
end);
Option.Required := False;
Option.HasValue := True;
end;
Looks pretty good I think.
Share this post
Subscribe to my newsletter
Get things that occur to me delivered straight to your inbox. Totally free, no spam.
Powered by Respectify
Comments are analyzed in real time for spam and respectfulness before they appear. Leave a comment to see Respectify in action.
Comments (…)
Loading comments…
No comments yet. Be the first to comment!
Leave a Comment
Your comment will be reviewed by Respectify before it appears.