-
Notifications
You must be signed in to change notification settings - Fork 288
Description
Implement a advice / alert / hint / Info / notice / notification / tip system.
Chose the system's name from the above candidates. Using tip for now because it's the shortest.
Can use the system to notify users about stuff, whenever they:
- run
mas - run a specific command
- encounter a certain issue
- etc.
Note:
- Each tip output will be labeled with a color-coded
Tip:prefix (or whatever name is chosen) - Each tip will be displayed in the same circumstances until a user hides it
- After each tip, a subsequent tip will inform users how to hide tips (until the tip-hiding tip is itself hidden).
- Tip hidings will be recorded using the Config System as the backend, but will probably have its own interface
- Tip hidings (& possibly other settings) will normally be left out of config system output for all settings
- The
--allflag formas configsubcommands will include them (& all other normally excluded settings) when desired
- The
- Tips will be namespaced via
tip.-prefixed setting names - Use a quaternary setting 2-bit mask for each tip:
- hidden
0b00 - always show:
0b11:: both interactive & non-interactive - only show for interactive shells:
0b01default for most (all?) tips - only for non-interactive shells:
0b10: this makes little sense, but including for completeness
- hidden
Interface:
Maybe rename "hide" as "dismiss"; if so, what should "show" change to?
mas tip (hide|show) [--interactive] [--non-interactive] <tip-name-glob>…
mas tip print [-q|--quiet] [<tip-name-glob>…]
Tip name x maps to setting name tip.x.
Globs allow multiple tips to be hidden / shown at once. * allows all to be hidden / shown.
hide normally hides for both interactive & non-interactive shells.
show normally shows for only interactive shells.
To perform hide or show on any other combo of interactive or non-interactive shells, use one or both of [--interactive] [--non-interactive].