Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Compulsory Arguments returning wrong value #17

@rajula96reddy

Description

@rajula96reddy

Hi,
When I don`t use compulsory args and try this

| pos1 command context match|
	pos1 := (ClapPositional withName: 'inputFile').
	command := (ClapCommand withName: 'MyApp')
		addPositional: pos1. 
 context := ClapContext on: #('MyApp' 'input.txt').
	match := command matchOn: context.
	(match at:pos1) value. "Returns input.txt"

But when I use compulsory args and try 
| pos1 command context match|
	pos1 := (ClapPositional withName: 'inputFile').
	command := (ClapCommand withName: 'MyApp')
		addCompulsory: (pos1) asCompulsory .
 context := ClapContext on: #('MyApp' 'input.txt').
	match := command matchOn: context.
	(match at:pos1) value. "Returns inputFile"

Shouldn`t they both return the same value. The second one is returning the positional name rather than the value. Am I doing it correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions