-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
split lakectl cmds - part 2 #6272
Conversation
No linked issues found. Please add the corresponding issues in the pull request description. |
7aa1973
to
1cf2d43
Compare
6683505
to
4d2f8de
Compare
1cf2d43
to
775c3e9
Compare
8015318
to
36207c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review
cmd/lakectl/cmd/tag.go
Outdated
@@ -146,15 +147,15 @@ var tagShowCmd = &cobra.Command{ | |||
Run: func(cmd *cobra.Command, args []string) { | |||
client := getClient() | |||
u := MustParseRefURI("tag", args[0]) | |||
Fmt("Tag ref: %s\n", u.String()) | |||
fmt.Printf("Tag ref: %s\n", u.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Tag ref: %s\n", u.String()) | |
fmt.Printf("Tag ref: %s\n", u) |
cmd/lakectl/cmd/tag.go
Outdated
@@ -130,7 +131,7 @@ var tagDeleteCmd = &cobra.Command{ | |||
} | |||
client := getClient() | |||
u := MustParseRefURI("tag", args[0]) | |||
Fmt("Tag ref: %s\n", u.String()) | |||
fmt.Printf("Tag ref: %s\n", u.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Tag ref: %s\n", u.String()) | |
fmt.Printf("Tag ref: %s\n", u) |
cmd/lakectl/cmd/ingest.go
Outdated
@@ -83,7 +84,7 @@ var ingestCmd = &cobra.Command{ | |||
} | |||
err = walker.Walk(ctx, block.WalkOptions{}, func(e block.ObjectStoreEntry) error { | |||
if dryRun { | |||
Fmt("%s\n", e) | |||
fmt.Printf("%s\n", e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("%s\n", e) | |
fmt.Println("%s", e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't use %s with Println - I've just passed e
cmd/lakectl/cmd/diff.go
Outdated
@@ -54,15 +54,15 @@ var diffCmd = &cobra.Command{ | |||
if len(args) == diffCmdMinArgs { | |||
// got one arg ref: uncommitted changes diff | |||
branchURI := MustParseRefURI("ref", args[0]) | |||
Fmt("Ref: %s\n", branchURI.String()) | |||
fmt.Printf("Ref: %s\n", branchURI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Ref: %s\n", branchURI) | |
fmt.Println("Ref: %s", branchURI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept Printf to use %s - we can drop the formatting and switch to use Println, but it is pretty equal.
cmd/lakectl/cmd/commit.go
Outdated
@@ -55,7 +56,7 @@ var commitCmd = &cobra.Command{ | |||
} | |||
|
|||
branchURI := MustParseRefURI("branch", args[0]) | |||
Fmt("Branch: %s\n", branchURI.String()) | |||
fmt.Printf("Branch: %s\n", branchURI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Branch: %s\n", branchURI) | |
fmt.Println("Branch: %s", branchURI) |
cmd/lakectl/cmd/branch.go
Outdated
@@ -116,7 +116,7 @@ var branchRevertCmd = &cobra.Command{ | |||
}, | |||
Run: func(cmd *cobra.Command, args []string) { | |||
u := MustParseBranchURI("branch", args[0]) | |||
Fmt("Branch: %s\n", u.String()) | |||
fmt.Printf("Branch: %s\n", u.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Branch: %s\n", u.String()) | |
fmt.Println("Branch: %s\n", u) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept the format and dropped the call to String()
cmd/lakectl/cmd/branch.go
Outdated
@@ -135,7 +135,7 @@ var branchRevertCmd = &cobra.Command{ | |||
Ref: commitRef, | |||
}) | |||
DieOnErrorOrUnexpectedStatusCode(resp, err, http.StatusNoContent) | |||
Fmt("commit %s successfully reverted\n", commitRef) | |||
fmt.Printf("commit %s successfully reverted\n", commitRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("commit %s successfully reverted\n", commitRef) | |
fmt.Println("commit %s successfully reverted", commitRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept the original
cmd/lakectl/cmd/branch.go
Outdated
@@ -154,7 +154,7 @@ var branchResetCmd = &cobra.Command{ | |||
Run: func(cmd *cobra.Command, args []string) { | |||
clt := getClient() | |||
u := MustParseBranchURI("branch", args[0]) | |||
Fmt("Branch: %s\n", u.String()) | |||
fmt.Printf("Branch: %s\n", u.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Branch: %s\n", u.String()) | |
fmt.Println("Branch: %s", u) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept the original format and dropped the call to String()
cmd/lakectl/cmd/branch.go
Outdated
@@ -205,14 +205,14 @@ var branchShowCmd = &cobra.Command{ | |||
Run: func(cmd *cobra.Command, args []string) { | |||
client := getClient() | |||
u := MustParseBranchURI("branch", args[0]) | |||
Fmt("Branch: %s\n", u.String()) | |||
fmt.Printf("Branch: %s\n", u.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Branch: %s\n", u.String()) | |
fmt.Println("Branch: %s", u) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept Printf and dropped the call to String()
cmd/lakectl/cmd/branch.go
Outdated
resp, err := client.GetBranchWithResponse(cmd.Context(), u.Repository, u.Ref) | ||
DieOnErrorOrUnexpectedStatusCode(resp, err, http.StatusOK) | ||
if resp.JSON200 == nil { | ||
Die("Bad response from server", 1) | ||
} | ||
branch := resp.JSON200 | ||
Fmt("Commit ID: %s\n", branch.CommitId) | ||
fmt.Printf("Commit ID: %s\n", branch.CommitId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Commit ID: %s\n", branch.CommitId) | |
fmt.Println("Commit ID: %s", branch.CommitId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept the original
36207c6
to
0bc68a6
Compare
@N-o-Z addressed all the comments some of them are part of the next PR.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nopcoder Thanks!
One comment regarding file naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename to auth_groups_members_list, this way it will sit lexicographically with the members sub command in the file tree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename to auth_groups_members_remove, this way it will sit lexicographically with the members sub command in the file tree
* lakectl cmd split part 2b * split lakectl cmds - part 3 (#6277) * lakectl cmd part 2 * lakectl cmd split part 3 * update cli docs * use Println instead of Printf when possible
part2 - end result will be based on #6254