Skip to content
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

fixes args issue for commands #301

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/harbor/root/labels/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func CreateLabelCommand() *cobra.Command {
Short: "create label",
Long: "create label in harbor",
Example: "harbor label create",
Args: cobra.NoArgs,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
var err error
createView := &create.CreateView{
Expand Down
1 change: 1 addition & 0 deletions cmd/harbor/root/labels/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func ListLabelCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "list labels",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
label, err := api.ListLabel(opts)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/harbor/root/project/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func ListProjectCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "list project",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
if private && public {
log.Fatal("Cannot specify both --private and --public flags")
Expand Down
2 changes: 1 addition & 1 deletion cmd/harbor/root/registry/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func CreateRegistryCommand() *cobra.Command {
Use: "create",
Short: "create registry",
Example: "harbor registry create",
Args: cobra.NoArgs,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
var err error
createView := &api.CreateRegView{
Expand Down
1 change: 1 addition & 0 deletions cmd/harbor/root/registry/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func ListRegistryCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "list registry",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
registry, err := api.ListRegistries(opts)

Expand Down
2 changes: 1 addition & 1 deletion cmd/harbor/root/user/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func UserCreateCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create",
Short: "create user",
Args: cobra.NoArgs,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
var err error
createView := &create.CreateView{
Expand Down
2 changes: 1 addition & 1 deletion cmd/harbor/root/user/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func UserListCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Short: "list users",
Args: cobra.NoArgs,
Args: cobra.ExactArgs(0),
Aliases: []string{"ls"},
Run: func(cmd *cobra.Command, args []string) {
response, err := api.ListUsers(opts)
Expand Down