mirror of
https://github.com/TangentFoxy/argparse.git
synced 2026-03-14 12:46:50 -06:00
Mark entire option as optional if there is default value
This commit is contained in:
+1
-1
@@ -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