Skip to content

Commit

Permalink
fix executor and flags setted function
Browse files Browse the repository at this point in the history
Signed-off-by: xcaspar <[email protected]>
  • Loading branch information
xcaspar committed May 8, 2020
1 parent 9b93660 commit b5039db
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ func (ecm *ExpCommandModel) Example() string {
func (ecm *ExpCommandModel) Actions() []ExpActionCommandSpec {
specs := make([]ExpActionCommandSpec, 0)
for idx := range ecm.ExpActions {
ecm.ExpActions[idx].executor = ecm.ExpExecutor
if ecm.ExpExecutor != nil {
ecm.ExpActions[idx].executor = ecm.ExpExecutor
}
specs = append(specs, &ecm.ExpActions[idx])
}
return specs
Expand All @@ -280,7 +282,11 @@ func (ecm *ExpCommandModel) Flags() []ExpFlagSpec {
}

func (ecm *ExpCommandModel) SetFlags(flags []ExpFlagSpec) {
// do nothing
expFlags := ecm.ExpFlags
for idx := range flags {
expFlags = append(expFlags, *flags[idx].(*ExpFlag))
}
ecm.ExpFlags = expFlags
}

type Models struct {
Expand Down

0 comments on commit b5039db

Please sign in to comment.