diff --git a/README.md b/README.md index 298b774..309c4d4 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ func prepareApp(opts ...cli.Opt) (app cli.App) { Description("a wrong command to return error for testing"). // cmdline `FORCE_RUN=1 go run ./tiny wrong -d 8s` to verify this command to see the returned application error. OnAction(func(ctx context.Context, cmd cli.Cmd, args []string) (err error) { - dur := cmdr.CmdStore().MustDuration("wrong.duration") + dur := cmd.Store().MustDuration("wrong.duration") println("the duration is:", dur.String()) ec := errors.New() diff --git a/tiny/litecmd.go b/tiny/litecmd.go index 9c41903..b61c083 100644 --- a/tiny/litecmd.go +++ b/tiny/litecmd.go @@ -65,8 +65,9 @@ func (s *liteCmdS) GetTitleName() string { return s.name() } func (s *liteCmdS) GetTitleNamesArray() []string { return []string{s.name()} } func (s *liteCmdS) GetTitleNames() string { return s.name() } -func (s *liteCmdS) App() cli.App { return nil } -func (s *liteCmdS) Set() store.Store { return s.Root().App().Store() } +func (s *liteCmdS) App() cli.App { return nil } +func (s *liteCmdS) Set() store.Store { return s.Root().App().Store() } +func (s *liteCmdS) Store() store.Store { return cmdr.CmdStore() } func (s *liteCmdS) OwnerIsValid() bool { if s.OwnerIsNotNil() { diff --git a/tiny/main.go b/tiny/main.go index 8ec1c59..cdc7a99 100644 --- a/tiny/main.go +++ b/tiny/main.go @@ -121,7 +121,7 @@ func prepareApp(opts ...cli.Opt) (app cli.App) { Description("a wrong command to return error for testing"). // cmdline `FORCE_RUN=1 go run ./tiny wrong -d 8s` to verify this command to see the returned application error. OnAction(func(ctx context.Context, cmd cli.Cmd, args []string) (err error) { - dur := cmdr.CmdStore().MustDuration("wrong.duration") + dur := cmd.Store().MustDuration("wrong.duration") println("the duration is:", dur.String()) ec := errors.New() diff --git a/tiny/tiny/main.go b/tiny/tiny/main.go index 7318c57..ef9920d 100644 --- a/tiny/tiny/main.go +++ b/tiny/tiny/main.go @@ -103,7 +103,7 @@ func prepareApp(opts ...cli.Opt) (app cli.App) { Description("a wrong command to return error for testing"). // cmdline `FORCE_RUN=1 go run ./tiny wrong -d 8s` to verify this command to see the returned application error. OnAction(func(ctx context.Context, cmd cli.Cmd, args []string) (err error) { - dur := cmdr.CmdStore().MustDuration("wrong.duration") + dur := cmd.Store().MustDuration("wrong.duration") println("the duration is:", dur.String()) ec := errors.New()