Re: How to get page break functionality in UEFI applications


Konstantin Aladyshev
 

I've managed to get the aforementioned functionality by using `EnablePageBreak` function from the EFI_SHELL_PROTOCOL:
```
EFI_SHELL_PROTOCOL* ShellProtocol;
Status = gBS->LocateProtocol(
&gEfiShellProtocolGuid,
NULL,
(VOID **)&ShellProtocol
);

if (EFI_ERROR(Status)) {
Print(L"Can't open EFI_SHELL_PROTOCOL: %r\n", Status);
return EFI_SUCCESS;
}

Print(L"PageBreak %s\n", (ShellProtocol->GetPageBreak()) ? L"enabled" : L"disabled");

ShellProtocol->EnablePageBreak();
```

But I still want to know, how to get automatic `-b` parameter parsing in your apps.

Also with this approach I've noticed that the `PageBreak` is always disabled at the start of an application. Why is this happening if `EFI_SHELL_PROTOCOL` is a global protocol? Why `PageBreak` is not enabled on the second launch of my application?

Join discuss@edk2.groups.io to automatically receive all group messages.