Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
kkga committed Sep 17, 2021
1 parent f913f80 commit f56f8d5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
16 changes: 8 additions & 8 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Cmd struct {
clientReq bool
bufferReq bool

kakContext *kak.Context
kctx *kak.Context

defaultSession string
useGitDirSessions bool
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f56f8d5

Please sign in to comment.