Skip to content

Commit

Permalink
🐛 fix public action value changed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed May 10, 2023
1 parent 6c66146 commit 7ffd7e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/arclet/alconna/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ def _handle_default(node: CommandNode):
act = node.action
if isinstance(node.default, (OptionResult, SubcommandResult)):
if act.type == 0 and act.value is ...:
act.value = node.default.value
node.action = Action(act.type, node.default.value)
if act.type == 1:
if not isinstance(node.default.value, list):
node.default.value = [node.default.value]
if act.value[0] is ...:
act.value = node.default.value[:]
node.action = Action(act.type, node.default.value[:])
if act.type == 2 and not isinstance(node.default.value, int):
node.default.value = 1
else:
if act.type == 0 and act.value is ...:
act.value = node.default
node.action = Action(act.type, node.default)
if act.type == 1:
if not isinstance(node.default, list):
node.default = [node.default]
if act.value[0] is ...:
act.value = node.default[:]
node.action = Action(act.type, node.default[:])
if act.type == 2 and not isinstance(node.default, int):
node.default = 1

Expand Down

0 comments on commit 7ffd7e2

Please sign in to comment.