canonical / canonical/inference-snaps

`modelctl debug` exits 0 on non-existent subcommand

Open Beginner friendly
#321 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
50
Forks
6
Avg merge
1d 20h
Merged PRs (30d)
7

Description

### Bug description

Found by @mrmara in https://github.com/canonical/nomic-embed-text-v1.5-snap/pull/1#discussion_r3658061623

### To reproduce

```
~/inference-snaps-workspace/inference-snaps-cli/cmd/modelctl$ go run . debug validate-engines ../../..
Developer/debugging commands

Usage:
cli debug [command]

Available Commands:
lint-package Validate engines, models, and runtimes manifest files
select-engine Test which engine will be chosen
chat Start the chat CLI providing connection parameters

Flags:
-h, --help help for debug

Global Flags:
-v, --verbose Enable verbose logging

Use "cli debug [command] --help" for more information about a command.
~/inference-snaps-workspace/inference-snaps-cli/cmd/modelctl$ echo $?
0
```

### Snap version

Tested with:
* v2.0.0-beta.8
* v2.0.0-beta.11
* commit 6a23692cd31245ed47dfb793bac158900bfe50b2

### System information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in cmd/modelctl and run the reported `go run . debug validate-engines ../../..` reproduction. Trace how the unknown `debug` subcommand is handled and verify the command exits nonzero while retaining the existing usage output. Add or update the relevant test if one is found nearby, then rerun the reproduction to confirm the exit status.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.