Skip to content

briefcase open doesn't support -a option #2635

@freakboy3742

Description

@freakboy3742

Describe the bug

Briefcase supports having multiple app definitions in a project. Many command support the -a option to select a single app from the list of all apps. However, the open command does not - it only supports opening all apps in a project.

Steps to reproduce

  1. Generate an empty project configuration for an app with a formal name of App 1
  2. Add the following to the bottom of the generated pyproject.toml:
[tool.briefcase.app.app2]
formal_name = "App2"
description = "My second application"
long_description = """More details about the app should go here.
"""
sources = [
    "src/app2",
]
  1. Duplicate the app content. From the same directory as pyproject.toml, run:
cp -r src/app1 src/app2

(or the windows equivalent, duplicating src/app1 as src/app2
4. Run briefcase create. Both build/app1 and build/app2 are created.
5. Run briefcase update. Observe from the console that both app1 and app2 are updated.
6. Run briefcase update -a app1. Observe from the console that only app1 is updated
7. Run briefcase open. Observe that both projects are opened (2 folders are opened in the file manager)
8. Run briefcase open -a app1
9. See error:

usage: briefcase open macOS app [-h] [-C KEY=VALUE] [-v] [-V] [--no-input]
                                [--log]
briefcase open macOS app: error: unrecognized arguments: -a app1

(the macOS app part will be platform specific)

Expected behavior

briefcase open -a app1 should open just app1.

Screenshots

No response

Environment

  • Operating System: All (tested on macOS)
  • Python version: All (tested on 3.13)
  • Software versions:
    • Briefcase: 0.3.26+

Logs


Additional context

To fix this: look at the parts of src/briefcase/commands/update.py handle the -a/--app option in add_options() and __call__().

Open does not currently have an add_options() method; it will need one to add the -a option.

For testing, check the test_update_app_single test in tests/commands/update/test_call.py; an analogous test will be required for open.

There is an existing test for test_open_single - this test verifies that you can pass a single app object; but there's no testing of passing in an app_name via command line arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.good first issueIs this your first time contributing? This could be a good place to start!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions