mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 19:12:19 +00:00
Mark entire option as optional if there is default value
This commit is contained in:
@@ -212,7 +212,7 @@ function Option:get_usage()
|
||||
table.insert(self._usage, 1, self._name)
|
||||
self._usage = table.concat(self._usage, " ")
|
||||
|
||||
if self._mincount == 0 then
|
||||
if self._mincount == 0 or self._default then
|
||||
self._usage = "[" .. self._usage .. "]"
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user