Skip to content

Commit 73fd2bc

Browse files
committed
lab: Update lab's description
lab is a command line utility for GitLab. It does wrap around git currently, however, that isn't lab's primary purpose. Update lab's description. Additional fix: Remove some dead code. Additional fix: Warn git wrapper users that git wrap functionality will eventually be removed. Signed-off-by: Prarit Bhargava <prarit@redhat.com>
1 parent c79e750 commit 73fd2bc

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

cmd/root.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// RootCmd represents the base command when called without any subcommands
2020
var RootCmd = &cobra.Command{
2121
Use: "lab",
22-
Short: "A Git Wrapper for GitLab",
22+
Short: "lab: A GitLab Command Line Interface Utility",
2323
Long: ``,
2424
Run: func(cmd *cobra.Command, args []string) {
2525
if ok, err := cmd.Flags().GetBool("version"); err == nil && ok {
@@ -76,13 +76,6 @@ func helpFunc(cmd *cobra.Command, args []string) {
7676
}
7777
return
7878
}
79-
80-
formatChar := "\n"
81-
git := git.New()
82-
git.Stdout = nil
83-
git.Stderr = nil
84-
usage, _ := git.CombinedOutput()
85-
fmt.Printf("%s%sThese GitLab commands are provided by lab:\n%s\n\n", string(usage), formatChar, labUsageFormat(cmd.Root()))
8679
}
8780

8881
var helpCmd = &cobra.Command{
@@ -206,6 +199,7 @@ func Execute() {
206199
}
207200

208201
// Passthrough to git for any unrecognized commands
202+
log.Println("Warning: lab's git passthrough command support will be removed in a later release.")
209203
err = git.New(os.Args[1:]...).Run()
210204
if exiterr, ok := err.(*exec.ExitError); ok {
211205
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
@@ -228,6 +222,7 @@ func Execute() {
228222
}
229223
}
230224
if !knownFlag {
225+
log.Println("Warning: lab's git passthrough command support will be removed in a later release.")
231226
git.New(os.Args[1:]...).Run()
232227
return
233228
}

cmd/root_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TestRootNoArg(t *testing.T) {
116116
t.Log(string(b))
117117
t.Fatal(err)
118118
}
119-
assert.Contains(t, string(b), `A Git Wrapper for GitLab
119+
assert.Contains(t, string(b), `lab: A GitLab Command Line Interface Utility
120120
121121
Usage:
122122
lab [flags]

0 commit comments

Comments
 (0)