diff --git a/cmd/frostfs-adm/internal/modules/morph/nns/tokens.go b/cmd/frostfs-adm/internal/modules/morph/nns/tokens.go index 6e8ffb40..19839992 100644 --- a/cmd/frostfs-adm/internal/modules/morph/nns/tokens.go +++ b/cmd/frostfs-adm/internal/modules/morph/nns/tokens.go @@ -6,10 +6,17 @@ import ( "github.com/spf13/cobra" ) +const ( + longFormat = "long" + longFormatShort = "l" + longFormatDesc = "Includes additional information about global domains." +) + func initTokensCmd() { - Cmd.AddCommand(tokensCmd) tokensCmd.Flags().StringP(commonflags.EndpointFlag, commonflags.EndpointFlagShort, "", commonflags.EndpointFlagDesc) tokensCmd.Flags().String(commonflags.AlphabetWalletsFlag, "", commonflags.AlphabetWalletsFlagDesc) + tokensCmd.Flags().BoolP(longFormat, longFormatShort, false, longFormatDesc) + Cmd.AddCommand(tokensCmd) } func listTokens(cmd *cobra.Command, _ []string) { @@ -18,7 +25,17 @@ func listTokens(cmd *cobra.Command, _ []string) { commonCmd.ExitOnErr(cmd, "unable to get tokens: %w", err) for toks, err := it.Next(10); err == nil && len(toks) > 0; toks, err = it.Next(10) { for _, token := range toks { - cmd.Println(string(token)) + info := "" + if longFlag, err := cmd.Flags().GetBool(longFormat); err == nil && longFlag { + info, err = c.GlobalDomainInfo(string(token)) + commonCmd.ExitOnErr(cmd, "unable to get global domain info: %w", err) + } + + if info == "" { + cmd.Println(string(token)) + } else { + cmd.Println(string(token), "(", info, ")") + } } } } diff --git a/go.mod b/go.mod index 0f608f74..f8c65768 100644 --- a/go.mod +++ b/go.mod @@ -129,3 +129,6 @@ require ( ) replace github.com/nspcc-dev/neo-go => git.frostfs.info/TrueCloudLab/neoneo-go v0.106.1-0.20240611123832-594f716b3d18 + +//replace git.frostfs.info/TrueCloudLab/frostfs-contract => /home/achuprov/Documents/work/frostfs-contract +replace git.frostfs.info/TrueCloudLab/frostfs-contract => git.frostfs.info/achuprov/frostfs-contract v0.18.1-0.20240808092722-b58602917706 diff --git a/go.sum b/go.sum index 355e176f..f98f4dc8 100644 Binary files a/go.sum and b/go.sum differ