Skip to content

feat: add ability to get command information from *State #4

@mfridman

Description

@mfridman

I currently handle retrieving flags (or env variables) from my application. I am able to print out something like:

error: must provide --dir flag or set DIR environment variable

However, it'd be nice if the command name could be printed so the error looks something like this (notice the extra command information):

error: command "goose status": must provide --dir flag or set DIR environment variable

This is currently not possible because path []*Command is unexported on the *State, and that object is the only thing available in Exec functions. We should consider exporting it, or adding a method to retrieve either the full command path or just the terminal command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions