Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request]: Warning/message display #18

Open
MHendricks opened this issue Dec 9, 2022 · 0 comments
Open

[Request]: Warning/message display #18

MHendricks opened this issue Dec 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@MHendricks
Copy link
Member

Description

Check for message and warning properties of the config or distro definition. If found they are printed to the console.

A potential use case for this is if you wanted to change the uri of a config commonly used by users and scripts. If you just update the config to the new name, any uses of the old config would just break. This would let you copy the old config and update it to the new name, then add a warning message to the old config telling the user to switch to the new config.

Solution

{
    "name": "not_set",
    "warning": "not_set is deprecated, use the uri is_not_set instead.",
    "context": [],
    "inherits": false,
    "distros": {
        "maya2020": []
    }
}

Adding the warning line to tests/configs/not_set/not_set.json would result in the WARNING line being added. This should be brightly colored if color is enabled.

$ hab dump not_set
Dump of FlatConfig('not_set')
--------------------------------------
WARNING: not_set is deprecated, use the uri is_not_set instead.
--------------------------------------
aliases:  maya mayapy pip
--------------------------------------

If message is used, it would also be shown, but without the need to draw as much attention to itself. These would be shown for all uses of that uri, not just the dump command.

Additional Context

No response

@MHendricks MHendricks added the enhancement New feature or request label Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant