Skip to content

Commit

Permalink
Fix multi generation cmd logic error (#182)
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Aug 11, 2023
1 parent 6dace1c commit 29fa4d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ func (s *CmdState) SetLabel(label string) {

// Spawn returns a child command connected to current state as parent.
func (s *CmdState) Spawn(label string) *CmdState {
p := s
for p.parent != nil {
p = p.parent
}
return &CmdState{
parent: s,
parent: p,
label: label,
}
}
Expand Down

0 comments on commit 29fa4d1

Please sign in to comment.