← Back to issue list

Add `is_default_command() -> bool`

View original Github issue

Metadata

Project
craft-cli
Number
#349
Type
issue
State
closed
Author
mr-cal
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed

Current evaluation

Closed as unnecessary: craft-cli added its own default-command deprecation warning in PR #362 (commit 5396c87), so no public detection API was added.

Resolution: closed not a bug

Reason: The maintainer rejected the proposed API because craft-cli would warn directly when the default command is used. PR #362 implemented that warning in commit 5396c87.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done - Set a private variable [here](https://github.com/canonical/craft-cli/blob/7f1408f30b255ff9d05c1dcdeafbce82b445176b/craft_cli/dispatcher.py#L523-L531) if the default command is used. - Add a new function `is_default_command() -> bool` that returns the value ### Why it needs to get done Snapcraft needs to be able to warn if the default command is used. Craft-cli is the best place for this to be detected.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Closed as unnecessary: craft-cli added its own default-command deprecation warning in PR #362 (commit 5396c87), so no public detection API was added.
stealth/space-bunny-alpha — closed not a bug API request rejected by mr-cal on 2025-07-03; craft-cli instead emits its own default-command warning via merged PR #362 (commit 5396c87), shipped in 3.1.0 with the #365 typo fix.
stealth/space-bunny-alpha — closed superseded API request rejected by maintainer; craft-cli instead emits its own default-command warning, merged in #362 (commit 5396c87), typo-fixed in #365 and turned into a hard error in #422.
stealth/space-bunny-alpha — closed superseded The API request was rejected; craft-cli instead emitted a built-in default-command warning via merged PR #362 (commit 5396c87).
qwen/qwen3.6-35b-a3b — — Rejected. The maintainer declined to expose the is_default_command function. Craft-cli will instead emit a built-in warning when the default command is invoked, removing the need for external detection.
qwen/qwen3.6-35b-a3b — — Rejected. The maintainer decided against exposing the is_default_command function. Craft-cli will instead emit a direct warning when the default command is used, removing the need for external detection.
qwen/qwen3.6-35b-a3b — — Rejected. The requested is_default_command function was abandoned as external exposure is no longer needed. Craft-cli will now emit a warning directly when the default command is used.

Update history

No update history recorded yet.

Related work

  • Superseded By: canonical/craft-cli#362 (confidence 100%)

    Added the default-command deprecation warning directly, replacing the proposed is_default_command() API.

Related issues

Issue Project State Summary Similarity
#5525 Add a warning for the default command snapcraft closed Closed unimplemented: #6074 removed the default command, but #6178 reverted that removal, leaving the requested warning absent pending craft-cli support.
76%