From f56f8d57c653ebd270735d842278037015e23361 Mon Sep 17 00:00:00 2001 From: Gadzhi Kharkharov Date: Fri, 17 Sep 2021 19:57:48 +0300 Subject: [PATCH] rename --- cmd/attach.go | 2 +- cmd/cat.go | 2 +- cmd/cmd.go | 16 ++++++++-------- cmd/get.go | 2 +- cmd/kill.go | 6 +++--- cmd/send.go | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cmd/attach.go b/cmd/attach.go index 9866ca5..7c50814 100644 --- a/cmd/attach.go +++ b/cmd/attach.go @@ -25,7 +25,7 @@ type AttachCmd struct { func (c *AttachCmd) Run() error { fp := kak.NewFilepath(c.fs.Args()) - if err := kak.Connect(c.kakContext, fp); err != nil { + if err := kak.Connect(c.kctx, fp); err != nil { return err } diff --git a/cmd/cat.go b/cmd/cat.go index cdffe3f..94efe76 100644 --- a/cmd/cat.go +++ b/cmd/cat.go @@ -38,7 +38,7 @@ func (c *CatCmd) Run() error { sendCmd := fmt.Sprintf("write -force %s", tmp.Name()) - if err := kak.Send(c.kakContext, sendCmd); err != nil { + if err := kak.Send(c.kctx, sendCmd); err != nil { return err } diff --git a/cmd/cmd.go b/cmd/cmd.go index 1f49708..1ae7b98 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -31,7 +31,7 @@ type Cmd struct { clientReq bool bufferReq bool - kakContext *kak.Context + kctx *kak.Context defaultSession string useGitDirSessions bool @@ -65,20 +65,20 @@ func (c *Cmd) Init(args []string) error { return err } - c.kakContext = &kak.Context{ + c.kctx = &kak.Context{ Session: kak.Session{Name: c.session}, Client: kak.Client{Name: c.client}, Buffer: kak.Buffer{Name: c.buffer}, } - if c.sessionReq && c.kakContext.Session.Name == "" { - return errors.New("no session in context") + if c.sessionReq && c.kctx.Session.Name == "" { + return errors.New("No session in context") } - if c.clientReq && c.kakContext.Client.Name == "" { - return errors.New("no client in context") + if c.clientReq && c.kctx.Client.Name == "" { + return errors.New("No client in context") } - if c.bufferReq && c.kakContext.Buffer.Name == "" { - return errors.New("no buffer in context") + if c.bufferReq && c.kctx.Buffer.Name == "" { + return errors.New("No buffer in context") } return nil diff --git a/cmd/get.go b/cmd/get.go index 723f3c5..160c58b 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -36,7 +36,7 @@ func (c *GetCmd) Run() error { return err } - resp, err := kak.Get(c.kakContext, query) + resp, err := kak.Get(c.kctx, query) if err != nil { return err } diff --git a/cmd/kill.go b/cmd/kill.go index 876f09b..c7ef7a2 100644 --- a/cmd/kill.go +++ b/cmd/kill.go @@ -29,7 +29,7 @@ func (c *KillCmd) Run() error { switch c.allSessions { case false: // TODO need to somehow trigger "no session" err - if err := kak.Send(c.kakContext, sendCmd); err != nil { + if err := kak.Send(c.kctx, sendCmd); err != nil { return err } case true: @@ -40,8 +40,8 @@ func (c *KillCmd) Run() error { for _, s := range sessions { sessCtx := &kak.Context{ Session: s, - Client: c.kakContext.Client, - Buffer: c.kakContext.Buffer, + Client: c.kctx.Client, + Buffer: c.kctx.Buffer, } if err := kak.Send(sessCtx, sendCmd); err != nil { return err diff --git a/cmd/send.go b/cmd/send.go index bc411d5..1383f89 100644 --- a/cmd/send.go +++ b/cmd/send.go @@ -33,7 +33,7 @@ func (c *SendCmd) Run() error { switch c.allClients { case false: // TODO: need to trigger "session not set" error - if err := kak.Send(c.kakContext, sendCmd); err != nil { + if err := kak.Send(c.kctx, sendCmd); err != nil { return err } case true: