From 74d2f2c8d36e83162a7aa1a15f2a262d9bdb2027 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Tue, 11 Oct 2022 17:02:03 +0300 Subject: [PATCH] [#1854] cli: Unify help messages Signed-off-by: Anton Nikiforov --- CHANGELOG.md | 1 + cmd/neofs-adm/internal/modules/config/root.go | 2 +- cmd/neofs-adm/internal/modules/morph/root.go | 78 +++++++++---------- cmd/neofs-adm/internal/modules/root.go | 4 +- .../internal/modules/storagecfg/root.go | 4 +- cmd/neofs-cli/internal/commonflags/flags.go | 12 +-- cmd/neofs-cli/internal/commonflags/session.go | 2 +- cmd/neofs-cli/modules/acl/extended/create.go | 8 +- cmd/neofs-cli/modules/bearer/create.go | 14 ++-- cmd/neofs-cli/modules/container/create.go | 14 ++-- cmd/neofs-cli/modules/container/delete.go | 4 +- cmd/neofs-cli/modules/container/get.go | 8 +- cmd/neofs-cli/modules/container/get_eacl.go | 4 +- cmd/neofs-cli/modules/container/list.go | 4 +- .../modules/container/list_objects.go | 2 +- cmd/neofs-cli/modules/control/root.go | 2 +- .../modules/control/set_netmap_status.go | 2 +- .../modules/control/shards_set_mode.go | 2 +- cmd/neofs-cli/modules/netmap/nodeinfo.go | 2 +- cmd/neofs-cli/modules/root.go | 2 +- cmd/neofs-cli/modules/session/create.go | 6 +- cmd/neofs-cli/modules/storagegroup/delete.go | 2 +- cmd/neofs-cli/modules/storagegroup/get.go | 2 +- cmd/neofs-cli/modules/util/keyer.go | 8 +- cmd/neofs-cli/modules/util/locode_generate.go | 2 +- cmd/neofs-cli/modules/util/locode_info.go | 2 +- cmd/neofs-lens/root.go | 2 +- pkg/util/gendoc/gendoc.go | 6 +- 28 files changed, 101 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a92353061..7c29cd3ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Changelog for NeoFS Node - Flush write-cache when moving shard to DEGRADED mode (#1825) - Make `morph.cache_ttl` default value equal to morph block time (#1846) - Policer marks nodes under maintenance as OK without requests (#1680) +- Unify help messages in CLI (#1854) ### Fixed - Description of command `netmap nodeinfo` (#1821) diff --git a/cmd/neofs-adm/internal/modules/config/root.go b/cmd/neofs-adm/internal/modules/config/root.go index bfbe3eef9..48a3b0c1c 100644 --- a/cmd/neofs-adm/internal/modules/config/root.go +++ b/cmd/neofs-adm/internal/modules/config/root.go @@ -25,5 +25,5 @@ neofs-adm config init --path .config/neofs-adm.yml`, func init() { RootCmd.AddCommand(initCmd) - initCmd.Flags().String(configPathFlag, "", "path to config (default ~/.neofs/adm/config.yml)") + initCmd.Flags().String(configPathFlag, "", "Path to config (default ~/.neofs/adm/config.yml)") } diff --git a/cmd/neofs-adm/internal/modules/morph/root.go b/cmd/neofs-adm/internal/modules/morph/root.go index 223e7b043..5d7aeeb8f 100644 --- a/cmd/neofs-adm/internal/modules/morph/root.go +++ b/cmd/neofs-adm/internal/modules/morph/root.go @@ -220,41 +220,41 @@ var ( func init() { RootCmd.AddCommand(generateAlphabetCmd) - generateAlphabetCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") - generateAlphabetCmd.Flags().Uint(alphabetSizeFlag, 7, "amount of alphabet wallets to generate") + generateAlphabetCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") + generateAlphabetCmd.Flags().Uint(alphabetSizeFlag, 7, "Amount of alphabet wallets to generate") RootCmd.AddCommand(initCmd) - initCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + initCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") initCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - initCmd.Flags().String(contractsInitFlag, "", "path to archive with compiled NeoFS contracts (default fetched from latest github release)") - initCmd.Flags().Uint(epochDurationCLIFlag, 240, "amount of side chain blocks in one NeoFS epoch") - initCmd.Flags().Uint(maxObjectSizeCLIFlag, 67108864, "max single object size in bytes") - initCmd.Flags().Bool(homomorphicHashDisabledCLIFlag, false, "disable object homomorphic hashing") + initCmd.Flags().String(contractsInitFlag, "", "Path to archive with compiled NeoFS contracts (default fetched from latest github release)") + initCmd.Flags().Uint(epochDurationCLIFlag, 240, "Amount of side chain blocks in one NeoFS epoch") + initCmd.Flags().Uint(maxObjectSizeCLIFlag, 67108864, "Max single object size in bytes") + initCmd.Flags().Bool(homomorphicHashDisabledCLIFlag, false, "Disable object homomorphic hashing") // Defaults are taken from neo-preodolenie. - initCmd.Flags().Uint64(containerFeeCLIFlag, 1000, "container registration fee") - initCmd.Flags().Uint64(containerAliasFeeCLIFlag, 500, "container alias fee") - initCmd.Flags().String(protoConfigPath, "", "path to the consensus node configuration") - initCmd.Flags().String(localDumpFlag, "", "path to the blocks dump file") + initCmd.Flags().Uint64(containerFeeCLIFlag, 1000, "Container registration fee") + initCmd.Flags().Uint64(containerAliasFeeCLIFlag, 500, "Container alias fee") + initCmd.Flags().String(protoConfigPath, "", "Path to the consensus node configuration") + initCmd.Flags().String(localDumpFlag, "", "Path to the blocks dump file") RootCmd.AddCommand(deployCmd) RootCmd.AddCommand(generateStorageCmd) - generateStorageCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + generateStorageCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") generateStorageCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - generateStorageCmd.Flags().String(storageWalletFlag, "", "path to new storage node wallet") - generateStorageCmd.Flags().String(storageGasCLIFlag, "", "initial amount of GAS to transfer") - generateStorageCmd.Flags().StringP(storageWalletLabelFlag, "l", "", "wallet label") + generateStorageCmd.Flags().String(storageWalletFlag, "", "Path to new storage node wallet") + generateStorageCmd.Flags().String(storageGasCLIFlag, "", "Initial amount of GAS to transfer") + generateStorageCmd.Flags().StringP(storageWalletLabelFlag, "l", "", "Wallet label") RootCmd.AddCommand(forceNewEpoch) - forceNewEpoch.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + forceNewEpoch.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") forceNewEpoch.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") RootCmd.AddCommand(removeNodes) - removeNodes.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + removeNodes.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") removeNodes.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") RootCmd.AddCommand(setPolicy) - setPolicy.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + setPolicy.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") setPolicy.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") RootCmd.AddCommand(dumpContractHashesCmd) @@ -265,48 +265,48 @@ func init() { dumpNetworkConfigCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") RootCmd.AddCommand(setConfig) - setConfig.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + setConfig.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") setConfig.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key") RootCmd.AddCommand(dumpBalancesCmd) dumpBalancesCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - dumpBalancesCmd.Flags().BoolP(dumpBalancesStorageFlag, "s", false, "dump balances of storage nodes from the current netmap") - dumpBalancesCmd.Flags().BoolP(dumpBalancesAlphabetFlag, "a", false, "dump balances of alphabet contracts") - dumpBalancesCmd.Flags().BoolP(dumpBalancesProxyFlag, "p", false, "dump balances of the proxy contract") - dumpBalancesCmd.Flags().Bool(dumpBalancesUseScriptHashFlag, false, "use script-hash format for addresses") + dumpBalancesCmd.Flags().BoolP(dumpBalancesStorageFlag, "s", false, "Dump balances of storage nodes from the current netmap") + dumpBalancesCmd.Flags().BoolP(dumpBalancesAlphabetFlag, "a", false, "Dump balances of alphabet contracts") + dumpBalancesCmd.Flags().BoolP(dumpBalancesProxyFlag, "p", false, "Dump balances of the proxy contract") + dumpBalancesCmd.Flags().Bool(dumpBalancesUseScriptHashFlag, false, "Use script-hash format for addresses") RootCmd.AddCommand(updateContractsCmd) - updateContractsCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + updateContractsCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") updateContractsCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - updateContractsCmd.Flags().String(contractsInitFlag, "", "path to archive with compiled NeoFS contracts (default fetched from latest github release)") + updateContractsCmd.Flags().String(contractsInitFlag, "", "Path to archive with compiled NeoFS contracts (default fetched from latest github release)") RootCmd.AddCommand(dumpContainersCmd) dumpContainersCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - dumpContainersCmd.Flags().String(containerDumpFlag, "", "file where to save dumped containers") - dumpContainersCmd.Flags().String(containerContractFlag, "", "container contract hash (for networks without NNS)") - dumpContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "containers to dump") + dumpContainersCmd.Flags().String(containerDumpFlag, "", "File where to save dumped containers") + dumpContainersCmd.Flags().String(containerContractFlag, "", "Container contract hash (for networks without NNS)") + dumpContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "Containers to dump") RootCmd.AddCommand(restoreContainersCmd) - restoreContainersCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + restoreContainersCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") restoreContainersCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - restoreContainersCmd.Flags().String(containerDumpFlag, "", "file to restore containers from") - restoreContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "containers to restore") + restoreContainersCmd.Flags().String(containerDumpFlag, "", "File to restore containers from") + restoreContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "Containers to restore") RootCmd.AddCommand(refillGasCmd) - refillGasCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir") + refillGasCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir") refillGasCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - refillGasCmd.Flags().String(storageWalletFlag, "", "path to storage node wallet") - refillGasCmd.Flags().String(walletAddressFlag, "", "address of wallet") - refillGasCmd.Flags().String(refillGasAmountFlag, "", "additional amount of GAS to transfer") + refillGasCmd.Flags().String(storageWalletFlag, "", "Path to storage node wallet") + refillGasCmd.Flags().String(walletAddressFlag, "", "Address of wallet") + refillGasCmd.Flags().String(refillGasAmountFlag, "", "Additional amount of GAS to transfer") refillGasCmd.MarkFlagsMutuallyExclusive(walletAddressFlag, storageWalletFlag) RootCmd.AddCommand(cmdSubnet) RootCmd.AddCommand(depositNotaryCmd) depositNotaryCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint") - depositNotaryCmd.Flags().String(storageWalletFlag, "", "path to storage node wallet") - depositNotaryCmd.Flags().String(walletAccountFlag, "", "wallet account address") - depositNotaryCmd.Flags().String(refillGasAmountFlag, "", "amount of GAS to deposit") - depositNotaryCmd.Flags().String(notaryDepositTillFlag, "", "notary deposit duration in blocks") + depositNotaryCmd.Flags().String(storageWalletFlag, "", "Path to storage node wallet") + depositNotaryCmd.Flags().String(walletAccountFlag, "", "Wallet account address") + depositNotaryCmd.Flags().String(refillGasAmountFlag, "", "Amount of GAS to deposit") + depositNotaryCmd.Flags().String(notaryDepositTillFlag, "", "Notary deposit duration in blocks") } diff --git a/cmd/neofs-adm/internal/modules/root.go b/cmd/neofs-adm/internal/modules/root.go index eb7c814a6..c8a9015f8 100644 --- a/cmd/neofs-adm/internal/modules/root.go +++ b/cmd/neofs-adm/internal/modules/root.go @@ -34,8 +34,8 @@ func init() { // use stdout as default output for cmd.Print() rootCmd.SetOut(os.Stdout) - rootCmd.PersistentFlags().StringP(configFlag, "c", "", "config file") - rootCmd.Flags().Bool("version", false, "application version") + rootCmd.PersistentFlags().StringP(configFlag, "c", "", "Config file") + rootCmd.Flags().Bool("version", false, "Application version") rootCmd.AddCommand(config.RootCmd) rootCmd.AddCommand(morph.RootCmd) diff --git a/cmd/neofs-adm/internal/modules/storagecfg/root.go b/cmd/neofs-adm/internal/modules/storagecfg/root.go index ace554c5b..2b89806c7 100644 --- a/cmd/neofs-adm/internal/modules/storagecfg/root.go +++ b/cmd/neofs-adm/internal/modules/storagecfg/root.go @@ -54,8 +54,8 @@ var RootCmd = &cobra.Command{ func init() { fs := RootCmd.Flags() - fs.StringP(walletFlag, "w", "", "path to wallet") - fs.StringP(accountFlag, "a", "", "wallet account") + fs.StringP(walletFlag, "w", "", "Path to wallet") + fs.StringP(accountFlag, "a", "", "Wallet account") } type config struct { diff --git a/cmd/neofs-cli/internal/commonflags/flags.go b/cmd/neofs-cli/internal/commonflags/flags.go index 53c4812bf..48fc0d4e6 100644 --- a/cmd/neofs-cli/internal/commonflags/flags.go +++ b/cmd/neofs-cli/internal/commonflags/flags.go @@ -13,31 +13,31 @@ const ( GenerateKey = "generate-key" generateKeyShorthand = "g" generateKeyDefault = false - generateKeyUsage = "generate new private key" + generateKeyUsage = "Generate new private key" WalletPath = "wallet" WalletPathShorthand = "w" WalletPathDefault = "" - WalletPathUsage = "path to the wallet or binary key" + WalletPathUsage = "Path to the wallet or binary key" Account = "address" AccountShorthand = "" AccountDefault = "" - AccountUsage = "address of wallet account" + AccountUsage = "Address of wallet account" RPC = "rpc-endpoint" RPCShorthand = "r" RPCDefault = "" - RPCUsage = "remote node address (as 'multiaddr' or ':')" + RPCUsage = "Remote node address (as 'multiaddr' or ':')" Timeout = "timeout" TimeoutShorthand = "t" TimeoutDefault = 15 * time.Second - TimeoutUsage = "timeout for an operation" + TimeoutUsage = "Timeout for an operation" Verbose = "verbose" VerboseShorthand = "v" - VerboseUsage = "verbose output" + VerboseUsage = "Verbose output" ForceFlag = "force" ForceFlagShorthand = "f" diff --git a/cmd/neofs-cli/internal/commonflags/session.go b/cmd/neofs-cli/internal/commonflags/session.go index b118b4f16..559ddc47d 100644 --- a/cmd/neofs-cli/internal/commonflags/session.go +++ b/cmd/neofs-cli/internal/commonflags/session.go @@ -9,6 +9,6 @@ func InitSession(cmd *cobra.Command) { cmd.Flags().String( SessionToken, "", - "path to a JSON-encoded container session token", + "Path to a JSON-encoded container session token", ) } diff --git a/cmd/neofs-cli/modules/acl/extended/create.go b/cmd/neofs-cli/modules/acl/extended/create.go index bdb5b5e79..88b23aa0f 100644 --- a/cmd/neofs-cli/modules/acl/extended/create.go +++ b/cmd/neofs-cli/modules/acl/extended/create.go @@ -50,10 +50,10 @@ neofs-cli acl extended create --cid EutHBsdT1YCzHxjCfQHnLPL1vFrkSyLSio4vkphfnEk } func init() { - createCmd.Flags().StringArrayP("rule", "r", nil, "extended ACL table record to apply") - createCmd.Flags().StringP("file", "f", "", "read list of extended ACL table records from from text file") - createCmd.Flags().StringP("out", "o", "", "save JSON formatted extended ACL table in file") - createCmd.Flags().StringP("cid", "", "", "container ID") + createCmd.Flags().StringArrayP("rule", "r", nil, "Extended ACL table record to apply") + createCmd.Flags().StringP("file", "f", "", "Read list of extended ACL table records from from text file") + createCmd.Flags().StringP("out", "o", "", "Save JSON formatted extended ACL table in file") + createCmd.Flags().StringP("cid", "", "", "Container ID") _ = cobra.MarkFlagFilename(createCmd.Flags(), "file") _ = cobra.MarkFlagFilename(createCmd.Flags(), "out") diff --git a/cmd/neofs-cli/modules/bearer/create.go b/cmd/neofs-cli/modules/bearer/create.go index 5d3ac2efe..c437ce3f7 100644 --- a/cmd/neofs-cli/modules/bearer/create.go +++ b/cmd/neofs-cli/modules/bearer/create.go @@ -38,13 +38,13 @@ is set to current epoch + n. } func init() { - createCmd.Flags().StringP(eaclFlag, "e", "", "path to the extended ACL table") - createCmd.Flags().StringP(issuedAtFlag, "i", "", "epoch to issue token at") - createCmd.Flags().StringP(notValidBeforeFlag, "n", "", "not valid before epoch") - createCmd.Flags().StringP(commonflags.ExpireAt, "x", "", "expiration epoch") - createCmd.Flags().StringP(ownerFlag, "o", "", "token owner") - createCmd.Flags().String(outFlag, "", "file to write token to") - createCmd.Flags().Bool(jsonFlag, false, "output token in JSON") + createCmd.Flags().StringP(eaclFlag, "e", "", "Path to the extended ACL table") + createCmd.Flags().StringP(issuedAtFlag, "i", "", "Epoch to issue token at") + createCmd.Flags().StringP(notValidBeforeFlag, "n", "", "Not valid before epoch") + createCmd.Flags().StringP(commonflags.ExpireAt, "x", "", "Expiration epoch") + createCmd.Flags().StringP(ownerFlag, "o", "", "Token owner") + createCmd.Flags().String(outFlag, "", "File to write token to") + createCmd.Flags().Bool(jsonFlag, false, "Output token in JSON") createCmd.Flags().StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage) _ = cobra.MarkFlagFilename(createCmd.Flags(), eaclFlag) diff --git a/cmd/neofs-cli/modules/container/create.go b/cmd/neofs-cli/modules/container/create.go index 8f79e0f6f..c306f41b5 100644 --- a/cmd/neofs-cli/modules/container/create.go +++ b/cmd/neofs-cli/modules/container/create.go @@ -142,17 +142,17 @@ func initContainerCreateCmd() { flags := createContainerCmd.Flags() - flags.StringVar(&containerACL, "basic-acl", acl.NamePrivate, fmt.Sprintf("hex encoded basic ACL value or keywords like '%s', '%s', '%s'", + flags.StringVar(&containerACL, "basic-acl", acl.NamePrivate, fmt.Sprintf("HEX encoded basic ACL value or keywords like '%s', '%s', '%s'", acl.NamePublicRW, acl.NamePrivate, acl.NamePublicROExtended, )) flags.StringVarP(&containerPolicy, "policy", "p", "", "QL-encoded or JSON-encoded placement policy or path to file with it") - flags.StringSliceVarP(&containerAttributes, "attributes", "a", nil, "comma separated pairs of container attributes in form of Key1=Value1,Key2=Value2") - flags.BoolVar(&containerAwait, "await", false, "block execution until container is persisted") - flags.StringVar(&containerName, "name", "", "container name attribute") - flags.BoolVar(&containerNoTimestamp, "disable-timestamp", false, "disable timestamp container attribute") - flags.StringVar(&containerSubnet, "subnet", "", "string representation of container subnetwork") + flags.StringSliceVarP(&containerAttributes, "attributes", "a", nil, "Comma separated pairs of container attributes in form of Key1=Value1,Key2=Value2") + flags.BoolVar(&containerAwait, "await", false, "Block execution until container is persisted") + flags.StringVar(&containerName, "name", "", "Container name attribute") + flags.BoolVar(&containerNoTimestamp, "disable-timestamp", false, "Disable timestamp container attribute") + flags.StringVar(&containerSubnet, "subnet", "", "String representation of container subnetwork") flags.BoolVarP(&force, commonflags.ForceFlag, commonflags.ForceFlagShorthand, false, - "skip placement validity check") + "Skip placement validity check") } func parseContainerPolicy(policyString string) (*netmap.PlacementPolicy, error) { diff --git a/cmd/neofs-cli/modules/container/delete.go b/cmd/neofs-cli/modules/container/delete.go index 8be62c3a2..05dc0def0 100644 --- a/cmd/neofs-cli/modules/container/delete.go +++ b/cmd/neofs-cli/modules/container/delete.go @@ -97,6 +97,6 @@ func initContainerDeleteCmd() { flags.StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage) flags.StringVar(&containerID, cidFlag, "", cidFlagUsage) - flags.BoolVar(&containerAwait, "await", false, "block execution until container is removed") - flags.BoolP(commonflags.ForceFlag, commonflags.ForceFlagShorthand, false, "do not check whether container contains locks and remove immediately") + flags.BoolVar(&containerAwait, "await", false, "Block execution until container is removed") + flags.BoolP(commonflags.ForceFlag, commonflags.ForceFlagShorthand, false, "Do not check whether container contains locks and remove immediately") } diff --git a/cmd/neofs-cli/modules/container/get.go b/cmd/neofs-cli/modules/container/get.go index 5fbcd9789..9655fc63a 100644 --- a/cmd/neofs-cli/modules/container/get.go +++ b/cmd/neofs-cli/modules/container/get.go @@ -18,10 +18,10 @@ import ( const ( cidFlag = "cid" - cidFlagUsage = "container ID" + cidFlagUsage = "Container ID" fromFlag = "from" - fromFlagUsage = "path to file with encoded container" + fromFlagUsage = "Path to file with encoded container" ) var ( @@ -65,9 +65,9 @@ func initContainerInfoCmd() { flags := getContainerInfoCmd.Flags() flags.StringVar(&containerID, cidFlag, "", cidFlagUsage) - flags.StringVar(&containerPathTo, "to", "", "path to dump encoded container") + flags.StringVar(&containerPathTo, "to", "", "Path to dump encoded container") flags.StringVar(&containerPathFrom, fromFlag, "", fromFlagUsage) - flags.BoolVar(&containerJSON, commonflags.JSON, false, "print or dump container in JSON format") + flags.BoolVar(&containerJSON, commonflags.JSON, false, "Print or dump container in JSON format") } type stringWriter cobra.Command diff --git a/cmd/neofs-cli/modules/container/get_eacl.go b/cmd/neofs-cli/modules/container/get_eacl.go index 81e636feb..2967efb03 100644 --- a/cmd/neofs-cli/modules/container/get_eacl.go +++ b/cmd/neofs-cli/modules/container/get_eacl.go @@ -58,6 +58,6 @@ func initContainerGetEACLCmd() { flags := getExtendedACLCmd.Flags() flags.StringVar(&containerID, cidFlag, "", cidFlagUsage) - flags.StringVar(&containerPathTo, "to", "", "path to dump encoded container (default: binary encoded)") - flags.BoolVar(&containerJSON, commonflags.JSON, false, "encode EACL table in json format") + flags.StringVar(&containerPathTo, "to", "", "Path to dump encoded container (default: binary encoded)") + flags.BoolVar(&containerJSON, commonflags.JSON, false, "Encode EACL table in json format") } diff --git a/cmd/neofs-cli/modules/container/list.go b/cmd/neofs-cli/modules/container/list.go index e1e495db4..8c2772e54 100644 --- a/cmd/neofs-cli/modules/container/list.go +++ b/cmd/neofs-cli/modules/container/list.go @@ -81,9 +81,9 @@ func initContainerListContainersCmd() { flags := listContainersCmd.Flags() flags.StringVar(&flagVarListContainerOwner, flagListContainerOwner, "", - "owner of containers (omit to use owner from private key)", + "Owner of containers (omit to use owner from private key)", ) flags.BoolVar(&flagVarListPrintAttr, flagListPrintAttr, false, - "request and print attributes of each container", + "Request and print attributes of each container", ) } diff --git a/cmd/neofs-cli/modules/container/list_objects.go b/cmd/neofs-cli/modules/container/list_objects.go index 5afa2c20d..fd24f0b01 100644 --- a/cmd/neofs-cli/modules/container/list_objects.go +++ b/cmd/neofs-cli/modules/container/list_objects.go @@ -91,6 +91,6 @@ func initContainerListObjectsCmd() { flags.StringVar(&containerID, cidFlag, "", cidFlagUsage) flags.BoolVar(&flagVarListObjectsPrintAttr, flagListObjectPrintAttr, false, - "request and print user attributes of each object", + "Request and print user attributes of each object", ) } diff --git a/cmd/neofs-cli/modules/control/root.go b/cmd/neofs-cli/modules/control/root.go index 515b60cab..f1c773b37 100644 --- a/cmd/neofs-cli/modules/control/root.go +++ b/cmd/neofs-cli/modules/control/root.go @@ -22,7 +22,7 @@ var Cmd = &cobra.Command{ const ( controlRPC = "endpoint" controlRPCDefault = "" - controlRPCUsage = "remote node control address (as 'multiaddr' or ':')" + controlRPCUsage = "Remote node control address (as 'multiaddr' or ':')" ) func init() { diff --git a/cmd/neofs-cli/modules/control/set_netmap_status.go b/cmd/neofs-cli/modules/control/set_netmap_status.go index f8153b0fc..7d18e69cb 100644 --- a/cmd/neofs-cli/modules/control/set_netmap_status.go +++ b/cmd/neofs-cli/modules/control/set_netmap_status.go @@ -33,7 +33,7 @@ func initControlSetNetmapStatusCmd() { flags.String(controlRPC, controlRPCDefault, controlRPCUsage) flags.String(netmapStatusFlag, "", - fmt.Sprintf("new netmap status keyword ('%s', '%s', '%s')", + fmt.Sprintf("New netmap status keyword ('%s', '%s', '%s')", netmapStatusOnline, netmapStatusOffline, netmapStatusMaintenance, diff --git a/cmd/neofs-cli/modules/control/shards_set_mode.go b/cmd/neofs-cli/modules/control/shards_set_mode.go index 46c13bf85..d44caf690 100644 --- a/cmd/neofs-cli/modules/control/shards_set_mode.go +++ b/cmd/neofs-cli/modules/control/shards_set_mode.go @@ -38,7 +38,7 @@ func initControlSetShardModeCmd() { flags.String(controlRPC, controlRPCDefault, controlRPCUsage) flags.String(shardIDFlag, "", "ID of the shard in base58 encoding") flags.String(shardModeFlag, "", - fmt.Sprintf("new shard mode keyword ('%s', '%s', '%s')", + fmt.Sprintf("New shard mode keyword ('%s', '%s', '%s')", shardModeReadWrite, shardModeReadOnly, shardModeDegraded, diff --git a/cmd/neofs-cli/modules/netmap/nodeinfo.go b/cmd/neofs-cli/modules/netmap/nodeinfo.go index 7ff94f6c1..570e10889 100644 --- a/cmd/neofs-cli/modules/netmap/nodeinfo.go +++ b/cmd/neofs-cli/modules/netmap/nodeinfo.go @@ -34,7 +34,7 @@ var nodeInfoCmd = &cobra.Command{ func initNodeInfoCmd() { commonflags.Init(nodeInfoCmd) commonflags.InitAPI(nodeInfoCmd) - nodeInfoCmd.Flags().Bool(nodeInfoJSONFlag, false, "print node info in JSON format") + nodeInfoCmd.Flags().Bool(nodeInfoJSONFlag, false, "Print node info in JSON format") } func prettyPrintNodeInfo(cmd *cobra.Command, i netmap.NodeInfo) { diff --git a/cmd/neofs-cli/modules/root.go b/cmd/neofs-cli/modules/root.go index 8191ac397..f539c991a 100644 --- a/cmd/neofs-cli/modules/root.go +++ b/cmd/neofs-cli/modules/root.go @@ -61,7 +61,7 @@ func init() { // Here you will define your flags and configuration settings. // Cobra supports persistent flags, which, if defined here, // will be global for your application. - rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file (default is $HOME/.config/neofs-cli/config.yaml)") + rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "Config file (default is $HOME/.config/neofs-cli/config.yaml)") rootCmd.PersistentFlags().BoolP(commonflags.Verbose, commonflags.VerboseShorthand, false, commonflags.VerboseUsage) diff --git a/cmd/neofs-cli/modules/session/create.go b/cmd/neofs-cli/modules/session/create.go index 6f0cff8ca..290241020 100644 --- a/cmd/neofs-cli/modules/session/create.go +++ b/cmd/neofs-cli/modules/session/create.go @@ -35,11 +35,11 @@ var createCmd = &cobra.Command{ } func init() { - createCmd.Flags().Uint64P(commonflags.Lifetime, "l", defaultLifetime, "number of epochs for token to stay valid") + createCmd.Flags().Uint64P(commonflags.Lifetime, "l", defaultLifetime, "Number of epochs for token to stay valid") createCmd.Flags().StringP(commonflags.WalletPath, commonflags.WalletPathShorthand, commonflags.WalletPathDefault, commonflags.WalletPathUsage) createCmd.Flags().StringP(commonflags.Account, commonflags.AccountShorthand, commonflags.AccountDefault, commonflags.AccountUsage) - createCmd.Flags().String(outFlag, "", "file to write session token to") - createCmd.Flags().Bool(jsonFlag, false, "output token in JSON") + createCmd.Flags().String(outFlag, "", "File to write session token to") + createCmd.Flags().Bool(jsonFlag, false, "Output token in JSON") createCmd.Flags().StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage) _ = cobra.MarkFlagRequired(createCmd.Flags(), commonflags.WalletPath) diff --git a/cmd/neofs-cli/modules/storagegroup/delete.go b/cmd/neofs-cli/modules/storagegroup/delete.go index 8ae5d8000..63e4576c5 100644 --- a/cmd/neofs-cli/modules/storagegroup/delete.go +++ b/cmd/neofs-cli/modules/storagegroup/delete.go @@ -27,7 +27,7 @@ func initSGDeleteCmd() { flags.String(cidFlag, "", "Container ID") _ = sgDelCmd.MarkFlagRequired(cidFlag) - flags.StringVarP(&sgID, sgIDFlag, "", "", "storage group identifier") + flags.StringVarP(&sgID, sgIDFlag, "", "", "Storage group identifier") _ = sgDelCmd.MarkFlagRequired(sgIDFlag) } diff --git a/cmd/neofs-cli/modules/storagegroup/get.go b/cmd/neofs-cli/modules/storagegroup/get.go index ab63ab1bd..a6ad85d5c 100644 --- a/cmd/neofs-cli/modules/storagegroup/get.go +++ b/cmd/neofs-cli/modules/storagegroup/get.go @@ -32,7 +32,7 @@ func initSGGetCmd() { flags.String(cidFlag, "", "Container ID") _ = sgGetCmd.MarkFlagRequired(cidFlag) - flags.StringVarP(&sgID, sgIDFlag, "", "", "storage group identifier") + flags.StringVarP(&sgID, sgIDFlag, "", "", "Storage group identifier") _ = sgGetCmd.MarkFlagRequired(sgIDFlag) flags.Bool(sgRawFlag, false, "Set raw request option") diff --git a/cmd/neofs-cli/modules/util/keyer.go b/cmd/neofs-cli/modules/util/keyer.go index 1ef19bc91..1f66a8866 100644 --- a/cmd/neofs-cli/modules/util/keyer.go +++ b/cmd/neofs-cli/modules/util/keyer.go @@ -20,10 +20,10 @@ var keyerCmd = &cobra.Command{ var errKeyerSingleArgument = errors.New("pass only one argument at a time") func initKeyerCmd() { - keyerCmd.Flags().BoolP("generate", "g", false, "generate new private key") - keyerCmd.Flags().Bool("hex", false, "print all values in hex encoding") - keyerCmd.Flags().BoolP("uncompressed", "u", false, "use uncompressed public key format") - keyerCmd.Flags().BoolP("multisig", "m", false, "calculate multisig address from public keys") + keyerCmd.Flags().BoolP("generate", "g", false, "Generate new private key") + keyerCmd.Flags().Bool("hex", false, "Print all values in hex encoding") + keyerCmd.Flags().BoolP("uncompressed", "u", false, "Use uncompressed public key format") + keyerCmd.Flags().BoolP("multisig", "m", false, "Calculate multisig address from public keys") } func processKeyer(cmd *cobra.Command, args []string) { diff --git a/cmd/neofs-cli/modules/util/locode_generate.go b/cmd/neofs-cli/modules/util/locode_generate.go index 670f6362f..be92a4abe 100644 --- a/cmd/neofs-cli/modules/util/locode_generate.go +++ b/cmd/neofs-cli/modules/util/locode_generate.go @@ -34,7 +34,7 @@ var ( locodeGenerateCmd = &cobra.Command{ Use: "generate", - Short: "generate UN/LOCODE database for NeoFS", + Short: "Generate UN/LOCODE database for NeoFS", Run: func(cmd *cobra.Command, _ []string) { locodeDB := csvlocode.New( csvlocode.Prm{ diff --git a/cmd/neofs-cli/modules/util/locode_info.go b/cmd/neofs-cli/modules/util/locode_info.go index ef2e2f3cf..927dfad93 100644 --- a/cmd/neofs-cli/modules/util/locode_info.go +++ b/cmd/neofs-cli/modules/util/locode_info.go @@ -18,7 +18,7 @@ var ( locodeInfoCmd = &cobra.Command{ Use: "info", - Short: "print information about UN/LOCODE from NeoFS database", + Short: "Print information about UN/LOCODE from NeoFS database", Run: func(cmd *cobra.Command, _ []string) { targetDB := locodebolt.New(locodebolt.Prm{ Path: locodeInfoDBPath, diff --git a/cmd/neofs-lens/root.go b/cmd/neofs-lens/root.go index 3e3854a76..c49d2d0dc 100644 --- a/cmd/neofs-lens/root.go +++ b/cmd/neofs-lens/root.go @@ -33,7 +33,7 @@ func entryPoint(cmd *cobra.Command, _ []string) error { func init() { // use stdout as default output for cmd.Print() command.SetOut(os.Stdout) - command.Flags().Bool("version", false, "application version") + command.Flags().Bool("version", false, "Application version") command.AddCommand( blobovnicza.Root, meta.Root, diff --git a/pkg/util/gendoc/gendoc.go b/pkg/util/gendoc/gendoc.go index 5b591e683..df0d32b21 100644 --- a/pkg/util/gendoc/gendoc.go +++ b/pkg/util/gendoc/gendoc.go @@ -77,9 +77,9 @@ In this case there is a number of helper functions which can be used: } ff := gendocCmd.Flags() - ff.StringP(gendocTypeFlag, "t", gendocMarkdown, "type for the documentation ('md' or 'man')") - ff.Int(depthFlag, 1, "if template is specified, unify all commands starting from depth in a single file. Default: 1.") - ff.StringP(extensionFlag, "e", "", "if the template is specified, string to append to the output file names") + ff.StringP(gendocTypeFlag, "t", gendocMarkdown, "Type for the documentation ('md' or 'man')") + ff.Int(depthFlag, 1, "If template is specified, unify all commands starting from depth in a single file. Default: 1.") + ff.StringP(extensionFlag, "e", "", "If the template is specified, string to append to the output file names") return gendocCmd }