From 19ab1b55d7bb845f53f97c4684bed73286e99afd Mon Sep 17 00:00:00 2001 From: FromTheRain Date: Wed, 11 Dec 2024 15:43:44 -0800 Subject: [PATCH] Cleaning up user command flags. (#253) Co-authored-by: Brandon Chatham --- pkg/user/admin/accept.go | 6 ++++-- pkg/user/admin/add_pending.go | 6 ++++-- pkg/user/admin/is_admin.go | 2 -- pkg/user/admin/is_pending.go | 2 -- pkg/user/admin/list.go | 2 -- pkg/user/admin/list_pending.go | 2 -- pkg/user/admin/remove.go | 6 ++++-- pkg/user/admin/remove_pending.go | 6 ++++-- pkg/user/appointee/batch_set.go | 9 ++++++++- pkg/user/appointee/list.go | 1 + pkg/user/appointee/list_permissions.go | 1 + pkg/user/appointee/remove.go | 5 ++++- pkg/user/appointee/set.go | 5 ++++- 13 files changed, 34 insertions(+), 19 deletions(-) diff --git a/pkg/user/admin/accept.go b/pkg/user/admin/accept.go index d91468eb..ca4a6ee5 100644 --- a/pkg/user/admin/accept.go +++ b/pkg/user/admin/accept.go @@ -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( diff --git a/pkg/user/admin/add_pending.go b/pkg/user/admin/add_pending.go index 5c5d4ddf..95877759 100644 --- a/pkg/user/admin/add_pending.go +++ b/pkg/user/admin/add_pending.go @@ -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 } diff --git a/pkg/user/admin/is_admin.go b/pkg/user/admin/is_admin.go index e29ca22d..05a2aac7 100644 --- a/pkg/user/admin/is_admin.go +++ b/pkg/user/admin/is_admin.go @@ -134,8 +134,6 @@ func IsAdminFlags() []cli.Flag { &flags.VerboseFlag, &AccountAddressFlag, &CallerAddressFlag, - &flags.OutputTypeFlag, - &flags.OutputFileFlag, &PermissionControllerAddressFlag, &flags.NetworkFlag, &flags.EnvironmentFlag, diff --git a/pkg/user/admin/is_pending.go b/pkg/user/admin/is_pending.go index 3c224c62..511bed08 100644 --- a/pkg/user/admin/is_pending.go +++ b/pkg/user/admin/is_pending.go @@ -142,8 +142,6 @@ func isPendingAdminFlags() []cli.Flag { &flags.VerboseFlag, &AccountAddressFlag, &PendingAdminAddressFlag, - &flags.OutputTypeFlag, - &flags.OutputFileFlag, &PermissionControllerAddressFlag, &flags.NetworkFlag, &flags.EnvironmentFlag, diff --git a/pkg/user/admin/list.go b/pkg/user/admin/list.go index c4423864..5169b4f7 100644 --- a/pkg/user/admin/list.go +++ b/pkg/user/admin/list.go @@ -134,8 +134,6 @@ func listAdminFlags() []cli.Flag { cmdFlags := []cli.Flag{ &flags.VerboseFlag, &AccountAddressFlag, - &flags.OutputFileFlag, - &flags.OutputTypeFlag, &PermissionControllerAddressFlag, &flags.NetworkFlag, &flags.EnvironmentFlag, diff --git a/pkg/user/admin/list_pending.go b/pkg/user/admin/list_pending.go index bf1b60ae..893d76de 100644 --- a/pkg/user/admin/list_pending.go +++ b/pkg/user/admin/list_pending.go @@ -142,8 +142,6 @@ func listPendingAdminsFlags() []cli.Flag { cmdFlags := []cli.Flag{ &flags.VerboseFlag, &AccountAddressFlag, - &flags.OutputTypeFlag, - &flags.OutputFileFlag, &PermissionControllerAddressFlag, &flags.NetworkFlag, &flags.EnvironmentFlag, diff --git a/pkg/user/admin/remove.go b/pkg/user/admin/remove.go index 4c0cd963..69c063ee 100644 --- a/pkg/user/admin/remove.go +++ b/pkg/user/admin/remove.go @@ -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 } diff --git a/pkg/user/admin/remove_pending.go b/pkg/user/admin/remove_pending.go index d9401028..b70edd29 100644 --- a/pkg/user/admin/remove_pending.go +++ b/pkg/user/admin/remove_pending.go @@ -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 } diff --git a/pkg/user/appointee/batch_set.go b/pkg/user/appointee/batch_set.go index cfd504f4..0861807e 100644 --- a/pkg/user/appointee/batch_set.go +++ b/pkg/user/appointee/batch_set.go @@ -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 } diff --git a/pkg/user/appointee/list.go b/pkg/user/appointee/list.go index c3487411..b6258715 100644 --- a/pkg/user/appointee/list.go +++ b/pkg/user/appointee/list.go @@ -152,6 +152,7 @@ func listFlags() []cli.Flag { &AccountAddressFlag, &TargetAddressFlag, &SelectorFlag, + &PermissionControllerAddressFlag, &flags.NetworkFlag, &flags.EnvironmentFlag, &flags.ETHRpcUrlFlag, diff --git a/pkg/user/appointee/list_permissions.go b/pkg/user/appointee/list_permissions.go index bffcee52..885d9a6c 100644 --- a/pkg/user/appointee/list_permissions.go +++ b/pkg/user/appointee/list_permissions.go @@ -151,6 +151,7 @@ func listPermissionFlags() []cli.Flag { &flags.VerboseFlag, &AccountAddressFlag, &AppointeeAddressFlag, + &PermissionControllerAddressFlag, &flags.NetworkFlag, &flags.EnvironmentFlag, &flags.ETHRpcUrlFlag, diff --git a/pkg/user/appointee/remove.go b/pkg/user/appointee/remove.go index 0026a3ee..b052019a 100644 --- a/pkg/user/appointee/remove.go +++ b/pkg/user/appointee/remove.go @@ -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 } diff --git a/pkg/user/appointee/set.go b/pkg/user/appointee/set.go index 5a1de8f7..fd715ec0 100644 --- a/pkg/user/appointee/set.go +++ b/pkg/user/appointee/set.go @@ -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 }