delphidabbler / pashi

Pascal syntax highlighter targetted at Delphi
https://delphidabbler.com/software/pashi
Other
21 stars 7 forks source link

Add `-` parameter to `--language` command #56

Open delphidabbler opened 2 years ago

delphidabbler commented 2 years ago

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.

delphidabbler commented 2 years ago

Since neutral is not a valid language identifier, could neutral be used as an alias for -?

delphidabbler commented 2 years ago

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;
delphidabbler commented 1 month ago

Added - and neutral options to --language and -l commands and deprecated --language-neutral at commit a1713219e955162c5e11a55ce987aa334189683f