[#1854] cli: Unify help messages

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2022-10-11 17:02:03 +03:00 committed by fyrchik
parent 9e2edfedc6
commit 74d2f2c8d3
28 changed files with 101 additions and 100 deletions

View file

@ -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)

View file

@ -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)")
}

View file

@ -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")
}

View file

@ -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)

View file

@ -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 {

View file

@ -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 '<host>:<port>')"
RPCUsage = "Remote node address (as 'multiaddr' or '<host>:<port>')"
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"

View file

@ -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",
)
}

View file

@ -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")

View file

@ -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)

View file

@ -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) {

View file

@ -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")
}

View file

@ -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

View file

@ -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")
}

View file

@ -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",
)
}

View file

@ -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",
)
}

View file

@ -22,7 +22,7 @@ var Cmd = &cobra.Command{
const (
controlRPC = "endpoint"
controlRPCDefault = ""
controlRPCUsage = "remote node control address (as 'multiaddr' or '<host>:<port>')"
controlRPCUsage = "Remote node control address (as 'multiaddr' or '<host>:<port>')"
)
func init() {

View file

@ -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,

View file

@ -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,

View file

@ -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) {

View file

@ -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)

View file

@ -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)

View file

@ -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)
}

View file

@ -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")

View file

@ -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) {

View file

@ -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{

View file

@ -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,

View file

@ -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,

View file

@ -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
}