Get option value as bool

Return true if the value with that key is empty or equals "true". Return false if the value with that key equals "false". Return null in any other case.

Property definitions

nitc $ CmdOptions :: opt_bool
	# Get option value as bool
	#
	# Return `true` if the value with that `key` is empty or equals `"true"`.
	# Return `false` if the value with that `key` equals `"false"`.
	# Return `null` in any other case.
	fun opt_bool(key: String): nullable Bool do
		if not has_key(key) then return null
		var value = self[key]
		if value.is_empty or value == "true" then return true
		if value == "false" then return false
		return null
	end
src/doc/commands/commands_parser.nit:432,2--443,4