Skip to content

Reading direnv's status could be confusing for newcomers #1211

@thenbe

Description

@thenbe

Is your feature request related to a problem? Please describe.
For unfamiliar users, it's not clear what the possible allowed state enum values (such as 0, 1, or 2) represent. example.

Describe the solution you'd like
we could make it more readable by taking a leaf out of the http book, where both a code and human-readable text are returned. For example:

status_code: 200
status_text: SUCCESS

status_code: 404
status_text: NOT FOUND
{
	"state": {
		"foundRC": {
			"status": {
				"code": 0,
				"text": "ALLOWED"
			},
			"path": "..."
		},
		"loadedRC": {
			"status": {
				"code": 2,
				"text": "DENIED"
			},
			"path": "..."
		}
	}
}

This solution is preferred as it would remain self-documenting as the codebase evolves.

Describe alternatives you've considered

  • document a human-readable description of all possible allowed states in direnv --help or direnv status --help
  • do nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions