Fix a typo in Colours.lua

Mere [06-26-13 - 19:04]
Fix a typo in Colours.lua

Add command usage when calling a sub-command with no params, or the wrong params.
Filename
Colours.lua
CommandLine.lua
diff --git a/Colours.lua b/Colours.lua
index 13ac9ad..3d516bb 100644
--- a/Colours.lua
+++ b/Colours.lua
@@ -111,7 +111,7 @@ MereHealingFrames.DefaultColours = {
 	},
     UnknownColour =
     {
-        r = 1, g = 1, g = 1, a = 1
+        r = 1, g = 1, b = 1, a = 1
     },
     HealthBarText = {
         r = 1, g = 1, b = 1, a = 1
diff --git a/CommandLine.lua b/CommandLine.lua
index 4f45a13..a3488e3 100644
--- a/CommandLine.lua
+++ b/CommandLine.lua
@@ -61,10 +61,11 @@ function MereHealingFrames.Commands.Help()
 	print ("/mhf show -- Show layouts")
 	print ("/mhf hide -- Hide layouts")
 	print ("/mhf list -- List layouts")
+    print ("/mhf layout -- layout configuration")
 	print ("/mhf tooltips -- Toggle tooltip display")
 	print ("/mhf debug -- debug/tracing options")
 	print ("/mhf spell -- spell configuration options")
-	print ("/mhf colour -- colour configuration options")
+	print ("/mhf colours -- colour configuration options")
 end


@@ -83,7 +84,11 @@ function MereHealingFrames.Commands.Layout(params)

 	local getOptParams = GetOpt.getopt(LayoutOptions, params);

-	if getOptParams == nil then return end
+	if getOptParams == nil then
+        print("/mhf layout should be followed by the options:")
+        GetOpt.print(LayoutOptions)
+        return
+    end
 	if (getOptParams.list) then
 		print("Found ".. #MereHealingFrames.Layouts .. " layout")
 		for key, layout in pairs(MereHealingFrames.Layouts) do
@@ -113,7 +118,10 @@ function MereHealingFrames.Commands.Layout(params)
 			if not layout:SetRoleFilter(getOptParams.filter) then
 				print("Invalid filter settings")
 			end
-		end
+        end
+    else
+        print("/mhf layout should be followed by the options:")
+        GetOpt.print(LayoutOptions)
 	end
 end

@@ -143,7 +151,11 @@ function MereHealingFrames.Commands.Spells(params)
 	table.remove(params,1)

 	local getOptParams = GetOpt.getopt(SpellOptions, params);
-	if (getOptParams == nil) then return end
+	if (getOptParams == nil) then
+        print("/mhf spell should be followed by the options:")
+        GetOpt.print(SpellOptions)
+        return
+    end

 	if (getOptParams.list) then
 		print("Listing current spell set")
@@ -203,14 +215,17 @@ function MereHealingFrames.Commands.Spells(params)
 		end
 		MereHealingFrames.Spells.UpdateCurrentSpells()
 		print("Spell set reset, and reloaded")
+    else
+        print("/mhf spell should be followed by the options:")
+        GetOpt.print(SpellOptions)
 	end
 end

 local ColourOptions = {
-		{"alpha", "a", "#", "alpha (optional, defaults to 1.0 if not specified)"},
-		{"red", "r", "#", "red" },
-		{"green", "g", "#", "green" },
-		{"blue", "b", "#", "blue" },
+		{"alpha", "a", "#", "alpha (optional, scale 0.0-1.0, defaults to 1.0 if not specified)"},
+		{"red", "r", "#", "red (scale 0.0-1.0)" },
+		{"green", "g", "#", "green (scale 0.0-1.0)" },
+		{"blue", "b", "#", "blue (scale 0.0-1.0)" },
 		{"name", "n", ":", "name of colour to adjust" },
 		{"list", "l", nil, "list current colours" },
 		{"default", "d", nil, "list default colours" },
@@ -222,8 +237,13 @@ function MereHealingFrames.Commands.Colours(params)
 	table.remove(params,1)

 	local getOptParams = GetOpt.getopt(ColourOptions, params);
-
-	if getOptParams == nil then return end
+
+    if(getOptParams == nil) then
+        print("/mhf colours should be followed by the options:")
+        GetOpt.print(ColourOptions)
+        return
+    end
+
 	if (getOptParams.list) then
 		print ("Non default colours\nName: red, green, blue, alpha")
 		for colour, colourvalues in pairs(MereHealingFrames.CurrentColours) do
@@ -232,7 +252,7 @@ function MereHealingFrames.Commands.Colours(params)
 	elseif (getOptParams.default) then
 		print ("Default colours\nName: red, green, blue, alpha")
 		for colour, colourvalues in pairs(MereHealingFrames.DefaultColours) do
-			print (string.format("%s: %f, %f, %f, %f", colour, colourvalues.r, colourvalues.g, colourvalues.b, colourvalues.a))
+            print (string.format("%s: %f, %f, %f, %f", colour, colourvalues.r, colourvalues.g, colourvalues.b, colourvalues.a))
 		end
 	elseif (getOptParams.reset) then
 		print ("All non-default colour choices have been reset, a /reloadui may be needed for colour change to take effect")
@@ -250,7 +270,10 @@ function MereHealingFrames.Commands.Colours(params)
 			else
 				print ("Unable to find colour called: " .. getOptParams.name)
 			end
-		end
+        end
+    else
+        print("/mhf colours should be followed by the options:")
+        GetOpt.print(ColourOptions)
 	end
 end

@@ -270,7 +293,11 @@ function MereHealingFrames.Commands.Debug(params)

 	local getOptParams = GetOpt.getopt(DebugOptions, params);

-	if getOptParams == nil then return end
+	if getOptParams == nil then
+        print("/mhf debug should be followed by the options:")
+        GetOpt.print(DebugOptions)
+        return
+    end

 	if (getOptParams.eventcounters) then
 		for key, value in pairs(MereHealingFrames.EventCounters) do
@@ -296,8 +323,10 @@ function MereHealingFrames.Commands.Debug(params)
 		MereHealingFrames.RaidManagement.AddFakes(20, false, 3, 6, 2, 9)
 	elseif (getOptParams.nofakes) then
 		MereHealingFrames.RaidManagement.RemoveFakes()
+    else
+        print("/mhf debug should be followed by the options:")
+        GetOpt.print(DebugOptions)
 	end
-
 end

 function MereHealingFrames.PanelWalk()