@ -370,18 +370,23 @@ class ConfigCLI(CLI):
text = [ ]
text = [ ]
for setting in sorted ( config ) :
for setting in sorted ( config ) :
changed = False
if isinstance ( config [ setting ] , Setting ) :
if isinstance ( config [ setting ] , Setting ) :
# proceed normally
if config [ setting ] . origin == ' default ' :
if config [ setting ] . origin == ' default ' :
color = ' green '
color = ' green '
elif config [ setting ] . origin == ' REQUIRED ' :
elif config [ setting ] . origin == ' REQUIRED ' :
# should include '_terms', '_input', etc
color = ' red '
color = ' red '
else :
else :
color = ' yellow '
color = ' yellow '
changed = True
msg = " %s ( %s ) = %s " % ( setting , config [ setting ] . origin , config [ setting ] . value )
msg = " %s ( %s ) = %s " % ( setting , config [ setting ] . origin , config [ setting ] . value )
else :
else :
color = ' green '
color = ' green '
msg = " %s ( %s ) = %s " % ( setting , ' default ' , config [ setting ] . get ( ' default ' ) )
msg = " %s ( %s ) = %s " % ( setting , ' default ' , config [ setting ] . get ( ' default ' ) )
if not context . CLIARGS [ ' only_changed ' ] or color == ' yellow ' :
if not context . CLIARGS [ ' only_changed ' ] or changed :
text . append ( stringc ( msg , color ) )
text . append ( stringc ( msg , color ) )
return text
return text
@ -445,6 +450,11 @@ class ConfigCLI(CLI):
o = ' REQUIRED '
o = ' REQUIRED '
else :
else :
raise e
raise e
if v is None and o is None :
# not all cases will be error
o = ' REQUIRED '
config_entries [ finalname ] [ setting ] = Setting ( setting , v , o , None )
config_entries [ finalname ] [ setting ] = Setting ( setting , v , o , None )
# pretty please!
# pretty please!