diff --git a/knack/commands.py b/knack/commands.py index 2843f69..c268b69 100644 --- a/knack/commands.py +++ b/knack/commands.py @@ -124,7 +124,10 @@ def update_argument(self, param_name, argtype): # that coincides with the default if isinstance(arg_default, str): arg_default = DefaultStr(arg_default) - elif isinstance(arg_default, int): + elif isinstance(arg_default, int) and not isinstance(arg_default, bool): + # bool's is_default is ignored for now, because + # 1. bool is a subclass of int, so isinstance(True, int) cannot distinguish between int and bool + # 2. bool is not extendable according to https://stackoverflow.com/a/2172204/2199657 arg_default = DefaultInt(arg_default) # update the default if arg_default: