Skip to content

Require a value for pud add --name (fixes #9) - #32

Merged
lemonhub-io merged 1 commit into
puddi-lang:mainfrom
Faizaanp:fix/add-name-require-value
Nov 29, 2026
Merged

lemonhub-io merged 1 commit into
puddi-lang:mainfrom
Faizaanp:fix/add-name-require-value

Conversation

@Faizaanp

Copy link
Copy Markdown
Contributor

Summary

Fixes #9.

In src/main.rs, CLI option parsing for --name previously ran:

"--name" => {
    i += 1;
    name_opt = opts.get(i).cloned();
}

When --name was passed at the end of arguments or without a following value, opts.get(i) was None. This set name_opt = None, causing pud add to silently fall back to deriving the default package name rather than raising an error.

This PR requires --name to have an explicit value, failing with error: --name needs a value (exit code 1), matching the existing pattern for --target ("--target needs a value") and -o ("-o needs a directory").

Changes

  • src/main.rs: Matched opts.get(i) on --name, returning fail("--name needs a value") when missing.
  • tests/run.rs: Added integration test pud_add_name_requires_value.
  • CHANGELOG.md: Added entry under ### Fixed.

Checklist

  • Tests: a regression test, or conformance cases for language behavior (see CONTRIBUTING.md)
  • CHANGELOG.md updated under Unreleased, for user-visible changes
  • README or documentation updated, if commands or behavior they describe changed (N/A - pud add usage was already documented as [--name n])

@ghfind-review ghfind-review Bot added the review: medium ghfind author score; see https://ghfind.com label Nov 28, 2026
@lemonhub-io
lemonhub-io merged commit a2f90a4 into puddi-lang:main Nov 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: medium ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report a missing dependency alias after pud add --name

2 participants