commit b2855b0fefaca3c53e1cf74559ebbeef5675c6f3
parent 6137c51463c9aa97d07cd7e53e2c499b5450e213
Author: Sean Enck <sean@ttypty.com>
Date: Sun, 8 Dec 2024 11:22:47 -0500
rename env -> var to be more clear it is no longer (shell) env
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/internal/app/commands/core.go b/internal/app/commands/core.go
@@ -31,7 +31,7 @@ const (
// Remove removes an entry
Remove = "rm"
// Env shows environment information used by lockbox
- Env = "env"
+ Env = "var"
// TOTPClip is the argument for copying totp codes to clipboard
TOTPClip = Clip
// TOTPMinimal is the argument for getting the short version of a code
diff --git a/internal/app/info_test.go b/internal/app/info_test.go
@@ -57,7 +57,7 @@ func TestEnvInfo(t *testing.T) {
os.Clearenv()
store.Clear()
var buf bytes.Buffer
- ok, err := app.Info(&buf, "env", []string{})
+ ok, err := app.Info(&buf, "var", []string{})
if !ok || err != nil {
t.Errorf("invalid error: %v", err)
}
@@ -66,7 +66,7 @@ func TestEnvInfo(t *testing.T) {
}
buf = bytes.Buffer{}
store.SetString("LOCKBOX_STORE", "1")
- ok, err = app.Info(&buf, "env", []string{})
+ ok, err = app.Info(&buf, "var", []string{})
if !ok || err != nil {
t.Errorf("invalid error: %v", err)
}
@@ -74,7 +74,7 @@ func TestEnvInfo(t *testing.T) {
t.Error("nothing written")
}
buf = bytes.Buffer{}
- ok, err = app.Info(&buf, "env", []string{"completions"})
+ ok, err = app.Info(&buf, "var", []string{"completions"})
if !ok || err != nil {
t.Errorf("invalid error: %v", err)
}
@@ -83,7 +83,7 @@ func TestEnvInfo(t *testing.T) {
}
store.SetString("LOCKBOX_READONLY", "true")
buf = bytes.Buffer{}
- ok, err = app.Info(&buf, "env", []string{"completions"})
+ ok, err = app.Info(&buf, "var", []string{"completions"})
if !ok || err != nil {
t.Errorf("invalid error: %v", err)
}
@@ -91,7 +91,7 @@ func TestEnvInfo(t *testing.T) {
t.Error("nothing written")
}
buf = bytes.Buffer{}
- ok, err = app.Info(&buf, "env", []string{"LOCKBOX_READONLY"})
+ ok, err = app.Info(&buf, "var", []string{"LOCKBOX_READONLY"})
if !ok || err != nil {
t.Errorf("invalid error: %v", err)
}
@@ -99,14 +99,14 @@ func TestEnvInfo(t *testing.T) {
t.Error("nothing written")
}
buf = bytes.Buffer{}
- ok, err = app.Info(&buf, "env", []string{"garbage"})
+ ok, err = app.Info(&buf, "var", []string{"garbage"})
if !ok || err != nil {
t.Errorf("invalid error: %v", err)
}
if buf.String() != "\n" {
t.Error("nothing written")
}
- if _, err = app.Info(&buf, "env", []string{"test", "default"}); err.Error() != "invalid env command, too many arguments" {
+ if _, err = app.Info(&buf, "var", []string{"test", "default"}); err.Error() != "invalid env command, too many arguments" {
t.Errorf("invalid error: %v", err)
}
}