Skip to content
  • Lubomir Rintel's avatar
    cli: rework enabling and disabling colors · 9dfe8258
    Lubomir Rintel authored
    This actually makes very little difference at the moment, but will make
    things more confortable later on, when the logic of enabling/disabling
    coloring will involve terminal-colors.d(5).
    
    Instead of deciding whether to use colors lazily with use_colors(), it's
    done very early on nmcli initialization and a boolean use_colors field
    is stored in the NmcConfig instance instead of the raw tristate option
    of NmcColorOption type (which is now confined to nmcli.c).
    
    Wherever the NmcColorOption was used previously, the whole NmcConfig
    instance is passed around. That might seem pointless (since only the
    use_colors boolean is actually used at the moment), but will be utilized
    to pass around the actual color palette in future.
    9dfe8258