Skip to content

Enhancement: flag for project level variables #520

Open
@thorntonrose

Description

@thorntonrose

Describe the feature:

I suggest adding a flag for specifying project level variables.

Example CLI usage:

mage -D pkg=./foo -D tests=TestBar test

Example Magefile usage:

func Test() {
   sh.cmd("bash", "-c", fmt.Sprintf("go test -run %s %s", tests, pkg))
}

Many other build tools do this or some variant.

What problem does this feature address?

This feature addresses the problem that environment variables have to be used for user specified, project level variables.

How does this benefit users of Mage?

Mage user can specify project level variables in a way that is not shell specific, for example mage test -D tests=TestFoo instead of TESTS=TestFoo mage test.

Additional context:

None.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions