Skip to content

unify(commandline): Move CommandLine to Core - #3037

Merged
xezon merged 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/commandline
Aug 1, 2026
Merged

unify(commandline): Move CommandLine to Core#3037
xezon merged 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/commandline

Conversation

@Jaredl-Dev

@Jaredl-Dev Jaredl-Dev commented Aug 1, 2026

Copy link
Copy Markdown

This moves CommandLine.h and CommandLine.cpp, shared by Generals and Zero Hour, into Core.

Both files are byte-identical between the two games.

Verification

  • Verified both complete files are byte-identical between Generals and Zero Hour
  • cmake --workflow --preset vc6
  • cmake --workflow --preset win32

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown

Greptile Summary

The PR consolidates the byte-identical Generals and Zero Hour command-line implementation into the shared Core GameEngine source set.

  • Moves CommandLine.h and CommandLine.cpp from the Generals tree into Core.
  • Removes both game-specific source-list entries and the duplicate Zero Hour files.
  • Records the completed move in the unification helper script.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains in the eligible follow-up review scope.

Important Files Changed

Filename Overview
Core/GameEngine/CMakeLists.txt Registers the unified command-line header and implementation in the shared GameEngine interface source set.
Core/GameEngine/Include/Common/CommandLine.h Relocates the unchanged command-line interface into Core.
Core/GameEngine/Source/Common/CommandLine.cpp Relocates the unchanged command-line implementation so each game target compiles the shared source.
Generals/Code/GameEngine/CMakeLists.txt Removes the Generals-local command-line files from its source list in favor of Core.
GeneralsMD/Code/GameEngine/CMakeLists.txt Removes the Zero Hour-local command-line files from its source list in favor of Core.
scripts/cpp/unify_move_files.py Documents the completed unification operations as disabled helper calls.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Core["Core CommandLine sources"]
    Generals["Generals GameEngine target"]
    ZeroHour["Zero Hour GameEngine target"]
    Core --> Generals
    Core --> ZeroHour
Loading

Reviews (2): Last reviewed commit: "unify(commandline): Move CommandLine to ..." | Re-trigger Greptile

@Jaredl-Dev Jaredl-Dev changed the title unify(commandline): Move CommandLine to core unify(commandline): Move CommandLine to Core Aug 1, 2026

@Skyaero42 Skyaero42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated with winmerge that these commandline is indeed equal in both games.

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change moves Generals to Core. It should always move GeneralsMD to Core. It looks like the error is that Generals has a Zero Hour header.

@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour Unify Unifies code between Generals and Zero Hour labels Aug 1, 2026
@Jaredl-Dev

Jaredl-Dev commented Aug 1, 2026

Copy link
Copy Markdown
Author

This change moves Generals to Core. It should always move GeneralsMD to Core. It looks like the error is that Generals has a Zero Hour header.

The script did move the GeneralsMD files, but GitHub matched the identical Generals files instead. I’ll fix the incorrect Generals banner in a separate PR, then rebase this one once it’s merged. Should the unify script be updated to account for byte-identical files like this? I could add a small warning to it to help avoid instances like this?

@xezon

xezon commented Aug 1, 2026

Copy link
Copy Markdown

Yes you can do that if you like.

Edit: Maybe is not needed. CommandLine files were the only offender.

@Jaredl-Dev
Jaredl-Dev force-pushed the unify/commandline branch 3 times, most recently from 0fc4bb7 to af31cef Compare August 1, 2026 20:40
@Jaredl-Dev

Copy link
Copy Markdown
Author

Yes you can do that if you like.

Edit: Maybe is not needed. CommandLine files were the only offender.

I have updated this pull request.

@xezon
xezon merged commit bf9099f into TheSuperHackers:main Aug 1, 2026
16 checks passed
@Jaredl-Dev
Jaredl-Dev deleted the unify/commandline branch August 1, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants