A clearer error for invalid slice names in Chisel

A small Chisel change that turns "invalid slice name" into a message that actually tells you what the rule is.

Chisel is Canonical’s tool for carving minimal Ubuntu container slices out of .deb packages. It is small, and most people meet it through its error messages in CI, so when canonical/chisel#158 sat open asking for a better diagnostic on a bad slice name, it was a good first contribution to pick up. canonical/chisel#240 (merged today) is that fix.

What was wrong

Slice names are validated by a regex in internal/setup/yaml.go:

var SnameExp = regexp.MustCompile(`^([a-z](?:-?[a-z0-9]){2,})$`)

Before this PR, if you typed cc, Foo, 1foo or foo--bar Chisel said:

error: invalid slice name cc in slices/base-distroless.yaml

That tells you the name is invalid and nothing else. You have no way to know which of the four constraints you tripped without going to read the source.

The change

The new message names the rule:

error: invalid slice name cc in slices/base-distroless.yaml
(slice names must be at least 3 characters long, start with a lowercase
letter, and contain only lowercase letters, digits, and hyphens)

The diff is 13 lines plus a unit test that pins the exact wording so it doesn’t drift later. Closes #158. The PR was labelled “Simple” and “Polish”, which is about right.