pashi icon indicating copy to clipboard operation
pashi copied to clipboard

Add `-` parameter to `--title` command to restore default title

Open delphidabbler opened this issue 3 years ago • 2 comments

To specify a document title the --title command is used, but to restore the default title the title-default command is required.

It would simplify things if --title - could be used instead of title-default to restore the default title.

title-default could then be deprecated.

delphidabbler avatar Oct 20 '22 01:10 delphidabbler

In the case statement of

https://github.com/delphidabbler/pashi/blob/787c0ba79e252ae730bb3477967e2c9ba007c80d/Src/UParams.pas#L666

Modify the code for --title & --title-default as follows:

    siTitle:
    begin
      var Param := GetStringParameter(Command);
      if Param = '-' then
        fConfig.Title := ''
      else
        fConfig.Title := Param;
      fParamQueue.Dequeue;
    end;
    siTitleDefault:
    begin
      fWarnings.Add(
        Format(sDeprecatedCmd, [AdjustCommandName(Command.Name, IsConfigCmd)])
      );
      // modify above warning to say to use `--title -`?
      fConfig.Title := '';
    end;

delphidabbler avatar Nov 08 '22 01:11 delphidabbler

Implemented title - / -t - and deprecated --title-default at commit 26cd604

delphidabbler avatar Sep 14 '24 04:09 delphidabbler