Skip to content

ShellPkg/UefiShellLevel3: Code cleanup/refactor#12513

Merged
mergify[bot] merged 8 commits intotianocore:masterfrom
pierregondois:pg/ShellPkgLevel3
May 1, 2026
Merged

ShellPkg/UefiShellLevel3: Code cleanup/refactor#12513
mergify[bot] merged 8 commits intotianocore:masterfrom
pierregondois:pg/ShellPkgLevel3

Conversation

@pierregondois
Copy link
Copy Markdown
Contributor

@pierregondois pierregondois commented Apr 28, 2026

Description

Small cleanup/refactor of the UefiShellLevel3 commands.
No functional change should be induced by these patches.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

Comment thread ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c Outdated
Comment thread ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c Outdated
Comment thread ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c Outdated
@pierregondois pierregondois force-pushed the pg/ShellPkgLevel3 branch 2 times, most recently from d41a22c to 21600ca Compare April 30, 2026 18:01
@leiflindholm leiflindholm added the push Auto push patch series in PR if all checks pass label May 1, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented May 1, 2026

Deprecation notice: This pull request comes from a fork and was queued with update_method=rebase and update_bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the merge queue will no longer be able to rebase fork pull requests with this configuration. To avoid disruption, switch to update_method=merge in your queue rule.

@mergify mergify Bot added the queued label May 1, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented May 1, 2026

Merge Queue Status

  • Entered queue2026-05-01 11:43 UTC · Rule: default
  • Checks passed · in-place
  • Merged2026-05-01 12:16 UTC · at 24b6abdfcebdaa35ad86c19fe54466ab1f66ad78 · rebase

This pull request spent 32 minutes 30 seconds in the queue, including 31 minutes 53 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = tianocore.PatchCheck
    • check-neutral = tianocore.PatchCheck
    • check-skipped = tianocore.PatchCheck
  • any of [🛡 GitHub branch protection]:
    • check-success = ArmVirtPkg - Ubuntu GCC - PR
    • check-neutral = ArmVirtPkg - Ubuntu GCC - PR
    • check-skipped = ArmVirtPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Ubuntu GCC - PR
    • check-neutral = EmulatorPkg - Ubuntu GCC - PR
    • check-skipped = EmulatorPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Windows VS - PR
    • check-neutral = EmulatorPkg - Windows VS - PR
    • check-skipped = EmulatorPkg - Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Ubuntu GCC - PR
    • check-neutral = OvmfPkg - Ubuntu GCC - PR
    • check-skipped = OvmfPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Windows VS - PR
    • check-neutral = OvmfPkg - Windows VS - PR
    • check-skipped = OvmfPkg - Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Windows VS - PR
    • check-neutral = Windows VS - PR
    • check-skipped = Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Ubuntu GCC - PR
    • check-neutral = Ubuntu GCC - PR
    • check-skipped = Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate Pull Request Formatting
    • check-neutral = Validate Pull Request Formatting
    • check-skipped = Validate Pull Request Formatting
  • any of [🛡 GitHub branch protection]:
    • check-success = ArmVirtPkg - Ubuntu - CLANGPDB
    • check-neutral = ArmVirtPkg - Ubuntu - CLANGPDB
    • check-skipped = ArmVirtPkg - Ubuntu - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Ubuntu - CLANGPDB
    • check-neutral = OvmfPkg - Ubuntu - CLANGPDB
    • check-skipped = OvmfPkg - Ubuntu - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = Ubuntu - CLANGPDB
    • check-neutral = Ubuntu - CLANGPDB
    • check-skipped = Ubuntu - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = Windows - CLANGPDB
    • check-neutral = Windows - CLANGPDB
    • check-skipped = Windows - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Windows - CLANGPDB
    • check-neutral = EmulatorPkg - Windows - CLANGPDB
    • check-skipped = EmulatorPkg - Windows - CLANGPDB

This patch aims to help breaking down the long function present in
the ShellPkg and reduce complexity/nested code and conditions.

Return directly if ShellCommandLineParse() returned an error Status.
In such case, the "Package" that should be allocated by
ShellCommandLineParse() is already freed in:
ShellCommandLineParse()
\-ShellCommandLineParseEx()
\-InternalCommandLineParse()
so there is no need to free it with ShellCommandLineFreeVarList().

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>
This patch aims to help breaking down the long function present in
the ShellPkg and reduce complexity/nested code and conditions.

Extract a MainCmdXXX() function for each shell command.
This command contains the possible operations the command aims
to operate. The ShellCommandRunXXX() function from which it
is extracted is only responsible of:
- initializing the shell/command environment
- parsing the command parameter and creating a Package
- freeing the Package

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>
Extract a ProcessFileList() in:
- Touch.c
- Type.c
to lower the indentation level and simplify the logic.

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>
Extract a PrintMatchingHelp() function in the Help command
to help splitting the logic MainCmdHelp() function.

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>
This patch aims to help breaking down the long function present in
the ShellPkg and reduce complexity/nested code and conditions.

Lower the indentation level in the newly created MainCmdXXX()
functions.

Some ASSERT() are removed in Help.c as they check variables
which were initialized a few lines above.

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>
@mergify mergify Bot merged commit f1f89f4 into tianocore:master May 1, 2026
161 of 162 checks passed
@mergify mergify Bot removed the queued label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

push Auto push patch series in PR if all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants