Skip to content

Commit

Permalink
Cleaning up user command flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Chatham committed Dec 11, 2024
1 parent b2a7aa7 commit 089b6f0
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 19 deletions.
6 changes: 4 additions & 2 deletions pkg/user/admin/accept.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,17 @@ func acceptFlags() []cli.Flag {
cmdFlags := []cli.Flag{
&flags.VerboseFlag,
&AccountAddressFlag,
&PermissionControllerAddressFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&flags.BroadcastFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&PermissionControllerAddressFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}

func generateAcceptAdminWriter(
Expand Down
6 changes: 4 additions & 2 deletions pkg/user/admin/add_pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ func addPendingFlags() []cli.Flag {
&flags.VerboseFlag,
&AccountAddressFlag,
&AdminAddressFlag,
&PermissionControllerAddressFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&flags.BroadcastFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&PermissionControllerAddressFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}
2 changes: 0 additions & 2 deletions pkg/user/admin/is_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ func IsAdminFlags() []cli.Flag {
&flags.VerboseFlag,
&AccountAddressFlag,
&CallerAddressFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
Expand Down
2 changes: 0 additions & 2 deletions pkg/user/admin/is_pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ func isPendingAdminFlags() []cli.Flag {
&flags.VerboseFlag,
&AccountAddressFlag,
&PendingAdminAddressFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
Expand Down
2 changes: 0 additions & 2 deletions pkg/user/admin/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ func listAdminFlags() []cli.Flag {
cmdFlags := []cli.Flag{
&flags.VerboseFlag,
&AccountAddressFlag,
&flags.OutputFileFlag,
&flags.OutputTypeFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
Expand Down
2 changes: 0 additions & 2 deletions pkg/user/admin/list_pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ func listPendingAdminsFlags() []cli.Flag {
cmdFlags := []cli.Flag{
&flags.VerboseFlag,
&AccountAddressFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
Expand Down
6 changes: 4 additions & 2 deletions pkg/user/admin/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ func removeFlags() []cli.Flag {
&flags.VerboseFlag,
&AccountAddressFlag,
&AdminAddressFlag,
&PermissionControllerAddressFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&flags.BroadcastFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&PermissionControllerAddressFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}
6 changes: 4 additions & 2 deletions pkg/user/admin/remove_pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ func removePendingAdminFlags() []cli.Flag {
&flags.VerboseFlag,
&AccountAddressFlag,
&AdminAddressFlag,
&PermissionControllerAddressFlag,
&flags.BroadcastFlag,
&flags.OutputTypeFlag,
&flags.OutputFileFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&PermissionControllerAddressFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}
9 changes: 8 additions & 1 deletion pkg/user/appointee/batch_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ func batchSetFlags() []cli.Flag {
cmdFlags := []cli.Flag{
&flags.VerboseFlag,
&BatchSetFileFlag,
// TODO: any other flags related to command inputs.
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&flags.BroadcastFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}
1 change: 1 addition & 0 deletions pkg/user/appointee/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func listFlags() []cli.Flag {
&AccountAddressFlag,
&TargetAddressFlag,
&SelectorFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
Expand Down
1 change: 1 addition & 0 deletions pkg/user/appointee/list_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func listPermissionFlags() []cli.Flag {
&flags.VerboseFlag,
&AccountAddressFlag,
&AppointeeAddressFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
Expand Down
5 changes: 4 additions & 1 deletion pkg/user/appointee/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,13 @@ func removeCommandFlags() []cli.Flag {
&AppointeeAddressFlag,
&TargetAddressFlag,
&SelectorFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&flags.BroadcastFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}
5 changes: 4 additions & 1 deletion pkg/user/appointee/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,13 @@ func setCommandFlags() []cli.Flag {
&AppointeeAddressFlag,
&TargetAddressFlag,
&SelectorFlag,
&PermissionControllerAddressFlag,
&flags.NetworkFlag,
&flags.EnvironmentFlag,
&flags.ETHRpcUrlFlag,
&flags.BroadcastFlag,
}
cmdFlags = append(cmdFlags, flags.GetSignerFlags()...)
sort.Sort(cli.FlagsByName(cmdFlags))
return append(cmdFlags, flags.GetSignerFlags()...)
return cmdFlags
}

0 comments on commit 089b6f0

Please sign in to comment.