pashi
pashi copied to clipboard
Add `-` parameter to `--language` command
Presently, --language takes a text parameter to set a language and --language-neutral is used to remove any specified language.
It would simplify things if --language - could be used to specify a language neutral document instead of having to use --language-neutral.
--language-neutral could then be deprecated.
Since neutral is not a valid language identifier, could neutral be used as an alias for -?
In the case statement of
https://github.com/delphidabbler/pashi/blob/787c0ba79e252ae730bb3477967e2c9ba007c80d/Src/UParams.pas#L666
Modify the code for --language & --language-default as follows:
siLanguage:
begin
var Param := GetStringParameter(Command);
if (Param = '-') or (Param = 'neutral') then
fConfig.Language := ''
else
fConfig.Language := Param;
fParamQueue.Dequeue;
end;
siLanguageNeutral:
begin
fWarnings.Add(
Format(sDeprecatedCmd, [AdjustCommandName(Command.Name, IsConfigCmd)])
);
// modify above warning to say to use `--language -`?
fConfig.Language := '';
end;
Added - and neutral options to --language and -l commands and deprecated --language-neutral at commit a1713219e955162c5e11a55ce987aa334189683f