Skip to content

Conversation

hxrshxz
Copy link

@hxrshxz hxrshxz commented Oct 10, 2025

Description

The CLI previously required sketches to follow strict naming convention where the main .pde file must match the folder name. This PR adds --main=<file> flag to support sketches with different main file names.

@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 18:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for specifying a custom main .pde file when running Processing sketches from the command line, allowing users to override the default naming convention that requires the main file to match the folder name.

  • Adds a new --main command-line argument to specify custom main .pde files
  • Implements validation to ensure the specified file has a .pde extension and exists within the sketch folder
  • Refactors the main file discovery logic to support both default and custom naming patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

// No extension or dot at end (e.g., "file" or "file.")
complainAndQuit("The main file must be a .pde file.", true);
}
String extension = mainFilename.substring(dotIndex + 1).toLowerCase(Locale.ENGLISH);
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The file extension validation logic should be extracted into a separate method to improve readability and reusability. Consider creating a validatePdeExtension(String filename) helper method.

Copilot uses AI. Check for mistakes.

@hxrshxz hxrshxz changed the title Fix Main .pde file Add --main flag to support sketches with different main .pde files Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant