forked from TrueCloudLab/frostfs-node
[#1854] cli: Unify help messages
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>support/v0.34
parent
9e2edfedc6
commit
74d2f2c8d3
|
@ -24,6 +24,7 @@ Changelog for NeoFS Node
|
||||||
- Flush write-cache when moving shard to DEGRADED mode (#1825)
|
- Flush write-cache when moving shard to DEGRADED mode (#1825)
|
||||||
- Make `morph.cache_ttl` default value equal to morph block time (#1846)
|
- Make `morph.cache_ttl` default value equal to morph block time (#1846)
|
||||||
- Policer marks nodes under maintenance as OK without requests (#1680)
|
- Policer marks nodes under maintenance as OK without requests (#1680)
|
||||||
|
- Unify help messages in CLI (#1854)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Description of command `netmap nodeinfo` (#1821)
|
- Description of command `netmap nodeinfo` (#1821)
|
||||||
|
|
|
@ -25,5 +25,5 @@ neofs-adm config init --path .config/neofs-adm.yml`,
|
||||||
func init() {
|
func init() {
|
||||||
RootCmd.AddCommand(initCmd)
|
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)")
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,41 +220,41 @@ var (
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
RootCmd.AddCommand(generateAlphabetCmd)
|
RootCmd.AddCommand(generateAlphabetCmd)
|
||||||
generateAlphabetCmd.Flags().String(alphabetWalletsFlag, "", "path to alphabet wallets dir")
|
generateAlphabetCmd.Flags().String(alphabetWalletsFlag, "", "Path to alphabet wallets dir")
|
||||||
generateAlphabetCmd.Flags().Uint(alphabetSizeFlag, 7, "amount of alphabet wallets to generate")
|
generateAlphabetCmd.Flags().Uint(alphabetSizeFlag, 7, "Amount of alphabet wallets to generate")
|
||||||
|
|
||||||
RootCmd.AddCommand(initCmd)
|
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().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().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(epochDurationCLIFlag, 240, "Amount of side chain blocks in one NeoFS epoch")
|
||||||
initCmd.Flags().Uint(maxObjectSizeCLIFlag, 67108864, "max single object size in bytes")
|
initCmd.Flags().Uint(maxObjectSizeCLIFlag, 67108864, "Max single object size in bytes")
|
||||||
initCmd.Flags().Bool(homomorphicHashDisabledCLIFlag, false, "disable object homomorphic hashing")
|
initCmd.Flags().Bool(homomorphicHashDisabledCLIFlag, false, "Disable object homomorphic hashing")
|
||||||
// Defaults are taken from neo-preodolenie.
|
// Defaults are taken from neo-preodolenie.
|
||||||
initCmd.Flags().Uint64(containerFeeCLIFlag, 1000, "container registration fee")
|
initCmd.Flags().Uint64(containerFeeCLIFlag, 1000, "Container registration fee")
|
||||||
initCmd.Flags().Uint64(containerAliasFeeCLIFlag, 500, "container alias fee")
|
initCmd.Flags().Uint64(containerAliasFeeCLIFlag, 500, "Container alias fee")
|
||||||
initCmd.Flags().String(protoConfigPath, "", "path to the consensus node configuration")
|
initCmd.Flags().String(protoConfigPath, "", "Path to the consensus node configuration")
|
||||||
initCmd.Flags().String(localDumpFlag, "", "path to the blocks dump file")
|
initCmd.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
|
|
||||||
RootCmd.AddCommand(deployCmd)
|
RootCmd.AddCommand(deployCmd)
|
||||||
|
|
||||||
RootCmd.AddCommand(generateStorageCmd)
|
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().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
generateStorageCmd.Flags().String(storageWalletFlag, "", "path to new storage node wallet")
|
generateStorageCmd.Flags().String(storageWalletFlag, "", "Path to new storage node wallet")
|
||||||
generateStorageCmd.Flags().String(storageGasCLIFlag, "", "initial amount of GAS to transfer")
|
generateStorageCmd.Flags().String(storageGasCLIFlag, "", "Initial amount of GAS to transfer")
|
||||||
generateStorageCmd.Flags().StringP(storageWalletLabelFlag, "l", "", "wallet label")
|
generateStorageCmd.Flags().StringP(storageWalletLabelFlag, "l", "", "Wallet label")
|
||||||
|
|
||||||
RootCmd.AddCommand(forceNewEpoch)
|
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")
|
forceNewEpoch.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
|
||||||
RootCmd.AddCommand(removeNodes)
|
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")
|
removeNodes.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
|
||||||
RootCmd.AddCommand(setPolicy)
|
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")
|
setPolicy.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
|
||||||
RootCmd.AddCommand(dumpContractHashesCmd)
|
RootCmd.AddCommand(dumpContractHashesCmd)
|
||||||
|
@ -265,48 +265,48 @@ func init() {
|
||||||
dumpNetworkConfigCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
dumpNetworkConfigCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
|
|
||||||
RootCmd.AddCommand(setConfig)
|
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().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key")
|
setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key")
|
||||||
|
|
||||||
RootCmd.AddCommand(dumpBalancesCmd)
|
RootCmd.AddCommand(dumpBalancesCmd)
|
||||||
dumpBalancesCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
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(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(dumpBalancesAlphabetFlag, "a", false, "Dump balances of alphabet contracts")
|
||||||
dumpBalancesCmd.Flags().BoolP(dumpBalancesProxyFlag, "p", false, "dump balances of the proxy contract")
|
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().Bool(dumpBalancesUseScriptHashFlag, false, "Use script-hash format for addresses")
|
||||||
|
|
||||||
RootCmd.AddCommand(updateContractsCmd)
|
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().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)
|
RootCmd.AddCommand(dumpContainersCmd)
|
||||||
dumpContainersCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
dumpContainersCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
dumpContainersCmd.Flags().String(containerDumpFlag, "", "file where to save dumped containers")
|
dumpContainersCmd.Flags().String(containerDumpFlag, "", "File where to save dumped containers")
|
||||||
dumpContainersCmd.Flags().String(containerContractFlag, "", "container contract hash (for networks without NNS)")
|
dumpContainersCmd.Flags().String(containerContractFlag, "", "Container contract hash (for networks without NNS)")
|
||||||
dumpContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "containers to dump")
|
dumpContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "Containers to dump")
|
||||||
|
|
||||||
RootCmd.AddCommand(restoreContainersCmd)
|
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().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
restoreContainersCmd.Flags().String(containerDumpFlag, "", "file to restore containers from")
|
restoreContainersCmd.Flags().String(containerDumpFlag, "", "File to restore containers from")
|
||||||
restoreContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "containers to restore")
|
restoreContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "Containers to restore")
|
||||||
|
|
||||||
RootCmd.AddCommand(refillGasCmd)
|
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().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
refillGasCmd.Flags().String(storageWalletFlag, "", "path to storage node wallet")
|
refillGasCmd.Flags().String(storageWalletFlag, "", "Path to storage node wallet")
|
||||||
refillGasCmd.Flags().String(walletAddressFlag, "", "address of wallet")
|
refillGasCmd.Flags().String(walletAddressFlag, "", "Address of wallet")
|
||||||
refillGasCmd.Flags().String(refillGasAmountFlag, "", "additional amount of GAS to transfer")
|
refillGasCmd.Flags().String(refillGasAmountFlag, "", "Additional amount of GAS to transfer")
|
||||||
refillGasCmd.MarkFlagsMutuallyExclusive(walletAddressFlag, storageWalletFlag)
|
refillGasCmd.MarkFlagsMutuallyExclusive(walletAddressFlag, storageWalletFlag)
|
||||||
|
|
||||||
RootCmd.AddCommand(cmdSubnet)
|
RootCmd.AddCommand(cmdSubnet)
|
||||||
|
|
||||||
RootCmd.AddCommand(depositNotaryCmd)
|
RootCmd.AddCommand(depositNotaryCmd)
|
||||||
depositNotaryCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
depositNotaryCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
|
||||||
depositNotaryCmd.Flags().String(storageWalletFlag, "", "path to storage node wallet")
|
depositNotaryCmd.Flags().String(storageWalletFlag, "", "Path to storage node wallet")
|
||||||
depositNotaryCmd.Flags().String(walletAccountFlag, "", "wallet account address")
|
depositNotaryCmd.Flags().String(walletAccountFlag, "", "Wallet account address")
|
||||||
depositNotaryCmd.Flags().String(refillGasAmountFlag, "", "amount of GAS to deposit")
|
depositNotaryCmd.Flags().String(refillGasAmountFlag, "", "Amount of GAS to deposit")
|
||||||
depositNotaryCmd.Flags().String(notaryDepositTillFlag, "", "notary deposit duration in blocks")
|
depositNotaryCmd.Flags().String(notaryDepositTillFlag, "", "Notary deposit duration in blocks")
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ func init() {
|
||||||
// use stdout as default output for cmd.Print()
|
// use stdout as default output for cmd.Print()
|
||||||
rootCmd.SetOut(os.Stdout)
|
rootCmd.SetOut(os.Stdout)
|
||||||
|
|
||||||
rootCmd.PersistentFlags().StringP(configFlag, "c", "", "config file")
|
rootCmd.PersistentFlags().StringP(configFlag, "c", "", "Config file")
|
||||||
rootCmd.Flags().Bool("version", false, "application version")
|
rootCmd.Flags().Bool("version", false, "Application version")
|
||||||
|
|
||||||
rootCmd.AddCommand(config.RootCmd)
|
rootCmd.AddCommand(config.RootCmd)
|
||||||
rootCmd.AddCommand(morph.RootCmd)
|
rootCmd.AddCommand(morph.RootCmd)
|
||||||
|
|
|
@ -54,8 +54,8 @@ var RootCmd = &cobra.Command{
|
||||||
func init() {
|
func init() {
|
||||||
fs := RootCmd.Flags()
|
fs := RootCmd.Flags()
|
||||||
|
|
||||||
fs.StringP(walletFlag, "w", "", "path to wallet")
|
fs.StringP(walletFlag, "w", "", "Path to wallet")
|
||||||
fs.StringP(accountFlag, "a", "", "wallet account")
|
fs.StringP(accountFlag, "a", "", "Wallet account")
|
||||||
}
|
}
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
|
|
@ -13,31 +13,31 @@ const (
|
||||||
GenerateKey = "generate-key"
|
GenerateKey = "generate-key"
|
||||||
generateKeyShorthand = "g"
|
generateKeyShorthand = "g"
|
||||||
generateKeyDefault = false
|
generateKeyDefault = false
|
||||||
generateKeyUsage = "generate new private key"
|
generateKeyUsage = "Generate new private key"
|
||||||
|
|
||||||
WalletPath = "wallet"
|
WalletPath = "wallet"
|
||||||
WalletPathShorthand = "w"
|
WalletPathShorthand = "w"
|
||||||
WalletPathDefault = ""
|
WalletPathDefault = ""
|
||||||
WalletPathUsage = "path to the wallet or binary key"
|
WalletPathUsage = "Path to the wallet or binary key"
|
||||||
|
|
||||||
Account = "address"
|
Account = "address"
|
||||||
AccountShorthand = ""
|
AccountShorthand = ""
|
||||||
AccountDefault = ""
|
AccountDefault = ""
|
||||||
AccountUsage = "address of wallet account"
|
AccountUsage = "Address of wallet account"
|
||||||
|
|
||||||
RPC = "rpc-endpoint"
|
RPC = "rpc-endpoint"
|
||||||
RPCShorthand = "r"
|
RPCShorthand = "r"
|
||||||
RPCDefault = ""
|
RPCDefault = ""
|
||||||
RPCUsage = "remote node address (as 'multiaddr' or '<host>:<port>')"
|
RPCUsage = "Remote node address (as 'multiaddr' or '<host>:<port>')"
|
||||||
|
|
||||||
Timeout = "timeout"
|
Timeout = "timeout"
|
||||||
TimeoutShorthand = "t"
|
TimeoutShorthand = "t"
|
||||||
TimeoutDefault = 15 * time.Second
|
TimeoutDefault = 15 * time.Second
|
||||||
TimeoutUsage = "timeout for an operation"
|
TimeoutUsage = "Timeout for an operation"
|
||||||
|
|
||||||
Verbose = "verbose"
|
Verbose = "verbose"
|
||||||
VerboseShorthand = "v"
|
VerboseShorthand = "v"
|
||||||
VerboseUsage = "verbose output"
|
VerboseUsage = "Verbose output"
|
||||||
|
|
||||||
ForceFlag = "force"
|
ForceFlag = "force"
|
||||||
ForceFlagShorthand = "f"
|
ForceFlagShorthand = "f"
|
||||||
|
|
|
@ -9,6 +9,6 @@ func InitSession(cmd *cobra.Command) {
|
||||||
cmd.Flags().String(
|
cmd.Flags().String(
|
||||||
SessionToken,
|
SessionToken,
|
||||||
"",
|
"",
|
||||||
"path to a JSON-encoded container session token",
|
"Path to a JSON-encoded container session token",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,10 @@ neofs-cli acl extended create --cid EutHBsdT1YCzHxjCfQHnLPL1vFrkSyLSio4vkphfnEk
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createCmd.Flags().StringArrayP("rule", "r", nil, "extended ACL table record to apply")
|
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("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("out", "o", "", "Save JSON formatted extended ACL table in file")
|
||||||
createCmd.Flags().StringP("cid", "", "", "container ID")
|
createCmd.Flags().StringP("cid", "", "", "Container ID")
|
||||||
|
|
||||||
_ = cobra.MarkFlagFilename(createCmd.Flags(), "file")
|
_ = cobra.MarkFlagFilename(createCmd.Flags(), "file")
|
||||||
_ = cobra.MarkFlagFilename(createCmd.Flags(), "out")
|
_ = cobra.MarkFlagFilename(createCmd.Flags(), "out")
|
||||||
|
|
|
@ -38,13 +38,13 @@ is set to current epoch + n.
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createCmd.Flags().StringP(eaclFlag, "e", "", "path to the extended ACL table")
|
createCmd.Flags().StringP(eaclFlag, "e", "", "Path to the extended ACL table")
|
||||||
createCmd.Flags().StringP(issuedAtFlag, "i", "", "epoch to issue token at")
|
createCmd.Flags().StringP(issuedAtFlag, "i", "", "Epoch to issue token at")
|
||||||
createCmd.Flags().StringP(notValidBeforeFlag, "n", "", "not valid before epoch")
|
createCmd.Flags().StringP(notValidBeforeFlag, "n", "", "Not valid before epoch")
|
||||||
createCmd.Flags().StringP(commonflags.ExpireAt, "x", "", "expiration epoch")
|
createCmd.Flags().StringP(commonflags.ExpireAt, "x", "", "Expiration epoch")
|
||||||
createCmd.Flags().StringP(ownerFlag, "o", "", "token owner")
|
createCmd.Flags().StringP(ownerFlag, "o", "", "Token owner")
|
||||||
createCmd.Flags().String(outFlag, "", "file to write token to")
|
createCmd.Flags().String(outFlag, "", "File to write token to")
|
||||||
createCmd.Flags().Bool(jsonFlag, false, "output token in JSON")
|
createCmd.Flags().Bool(jsonFlag, false, "Output token in JSON")
|
||||||
createCmd.Flags().StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage)
|
createCmd.Flags().StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage)
|
||||||
|
|
||||||
_ = cobra.MarkFlagFilename(createCmd.Flags(), eaclFlag)
|
_ = cobra.MarkFlagFilename(createCmd.Flags(), eaclFlag)
|
||||||
|
|
|
@ -142,17 +142,17 @@ func initContainerCreateCmd() {
|
||||||
|
|
||||||
flags := createContainerCmd.Flags()
|
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,
|
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.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.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.BoolVar(&containerAwait, "await", false, "Block execution until container is persisted")
|
||||||
flags.StringVar(&containerName, "name", "", "container name attribute")
|
flags.StringVar(&containerName, "name", "", "Container name attribute")
|
||||||
flags.BoolVar(&containerNoTimestamp, "disable-timestamp", false, "disable timestamp container attribute")
|
flags.BoolVar(&containerNoTimestamp, "disable-timestamp", false, "Disable timestamp container attribute")
|
||||||
flags.StringVar(&containerSubnet, "subnet", "", "string representation of container subnetwork")
|
flags.StringVar(&containerSubnet, "subnet", "", "String representation of container subnetwork")
|
||||||
flags.BoolVarP(&force, commonflags.ForceFlag, commonflags.ForceFlagShorthand, false,
|
flags.BoolVarP(&force, commonflags.ForceFlag, commonflags.ForceFlagShorthand, false,
|
||||||
"skip placement validity check")
|
"Skip placement validity check")
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseContainerPolicy(policyString string) (*netmap.PlacementPolicy, error) {
|
func parseContainerPolicy(policyString string) (*netmap.PlacementPolicy, error) {
|
||||||
|
|
|
@ -97,6 +97,6 @@ func initContainerDeleteCmd() {
|
||||||
flags.StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage)
|
flags.StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage)
|
||||||
|
|
||||||
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
||||||
flags.BoolVar(&containerAwait, "await", false, "block execution until container is removed")
|
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.BoolP(commonflags.ForceFlag, commonflags.ForceFlagShorthand, false, "Do not check whether container contains locks and remove immediately")
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
cidFlag = "cid"
|
cidFlag = "cid"
|
||||||
cidFlagUsage = "container ID"
|
cidFlagUsage = "Container ID"
|
||||||
|
|
||||||
fromFlag = "from"
|
fromFlag = "from"
|
||||||
fromFlagUsage = "path to file with encoded container"
|
fromFlagUsage = "Path to file with encoded container"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -65,9 +65,9 @@ func initContainerInfoCmd() {
|
||||||
flags := getContainerInfoCmd.Flags()
|
flags := getContainerInfoCmd.Flags()
|
||||||
|
|
||||||
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
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.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
|
type stringWriter cobra.Command
|
||||||
|
|
|
@ -58,6 +58,6 @@ func initContainerGetEACLCmd() {
|
||||||
flags := getExtendedACLCmd.Flags()
|
flags := getExtendedACLCmd.Flags()
|
||||||
|
|
||||||
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
||||||
flags.StringVar(&containerPathTo, "to", "", "path to dump encoded container (default: binary encoded)")
|
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.BoolVar(&containerJSON, commonflags.JSON, false, "Encode EACL table in json format")
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,9 +81,9 @@ func initContainerListContainersCmd() {
|
||||||
flags := listContainersCmd.Flags()
|
flags := listContainersCmd.Flags()
|
||||||
|
|
||||||
flags.StringVar(&flagVarListContainerOwner, flagListContainerOwner, "",
|
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,
|
flags.BoolVar(&flagVarListPrintAttr, flagListPrintAttr, false,
|
||||||
"request and print attributes of each container",
|
"Request and print attributes of each container",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,6 @@ func initContainerListObjectsCmd() {
|
||||||
|
|
||||||
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
flags.StringVar(&containerID, cidFlag, "", cidFlagUsage)
|
||||||
flags.BoolVar(&flagVarListObjectsPrintAttr, flagListObjectPrintAttr, false,
|
flags.BoolVar(&flagVarListObjectsPrintAttr, flagListObjectPrintAttr, false,
|
||||||
"request and print user attributes of each object",
|
"Request and print user attributes of each object",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ var Cmd = &cobra.Command{
|
||||||
const (
|
const (
|
||||||
controlRPC = "endpoint"
|
controlRPC = "endpoint"
|
||||||
controlRPCDefault = ""
|
controlRPCDefault = ""
|
||||||
controlRPCUsage = "remote node control address (as 'multiaddr' or '<host>:<port>')"
|
controlRPCUsage = "Remote node control address (as 'multiaddr' or '<host>:<port>')"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -33,7 +33,7 @@ func initControlSetNetmapStatusCmd() {
|
||||||
|
|
||||||
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
|
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
|
||||||
flags.String(netmapStatusFlag, "",
|
flags.String(netmapStatusFlag, "",
|
||||||
fmt.Sprintf("new netmap status keyword ('%s', '%s', '%s')",
|
fmt.Sprintf("New netmap status keyword ('%s', '%s', '%s')",
|
||||||
netmapStatusOnline,
|
netmapStatusOnline,
|
||||||
netmapStatusOffline,
|
netmapStatusOffline,
|
||||||
netmapStatusMaintenance,
|
netmapStatusMaintenance,
|
||||||
|
|
|
@ -38,7 +38,7 @@ func initControlSetShardModeCmd() {
|
||||||
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
|
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
|
||||||
flags.String(shardIDFlag, "", "ID of the shard in base58 encoding")
|
flags.String(shardIDFlag, "", "ID of the shard in base58 encoding")
|
||||||
flags.String(shardModeFlag, "",
|
flags.String(shardModeFlag, "",
|
||||||
fmt.Sprintf("new shard mode keyword ('%s', '%s', '%s')",
|
fmt.Sprintf("New shard mode keyword ('%s', '%s', '%s')",
|
||||||
shardModeReadWrite,
|
shardModeReadWrite,
|
||||||
shardModeReadOnly,
|
shardModeReadOnly,
|
||||||
shardModeDegraded,
|
shardModeDegraded,
|
||||||
|
|
|
@ -34,7 +34,7 @@ var nodeInfoCmd = &cobra.Command{
|
||||||
func initNodeInfoCmd() {
|
func initNodeInfoCmd() {
|
||||||
commonflags.Init(nodeInfoCmd)
|
commonflags.Init(nodeInfoCmd)
|
||||||
commonflags.InitAPI(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) {
|
func prettyPrintNodeInfo(cmd *cobra.Command, i netmap.NodeInfo) {
|
||||||
|
|
|
@ -61,7 +61,7 @@ func init() {
|
||||||
// Here you will define your flags and configuration settings.
|
// Here you will define your flags and configuration settings.
|
||||||
// Cobra supports persistent flags, which, if defined here,
|
// Cobra supports persistent flags, which, if defined here,
|
||||||
// will be global for your application.
|
// 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,
|
rootCmd.PersistentFlags().BoolP(commonflags.Verbose, commonflags.VerboseShorthand,
|
||||||
false, commonflags.VerboseUsage)
|
false, commonflags.VerboseUsage)
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ var createCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
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.WalletPath, commonflags.WalletPathShorthand, commonflags.WalletPathDefault, commonflags.WalletPathUsage)
|
||||||
createCmd.Flags().StringP(commonflags.Account, commonflags.AccountShorthand, commonflags.AccountDefault, commonflags.AccountUsage)
|
createCmd.Flags().StringP(commonflags.Account, commonflags.AccountShorthand, commonflags.AccountDefault, commonflags.AccountUsage)
|
||||||
createCmd.Flags().String(outFlag, "", "file to write session token to")
|
createCmd.Flags().String(outFlag, "", "File to write session token to")
|
||||||
createCmd.Flags().Bool(jsonFlag, false, "output token in JSON")
|
createCmd.Flags().Bool(jsonFlag, false, "Output token in JSON")
|
||||||
createCmd.Flags().StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage)
|
createCmd.Flags().StringP(commonflags.RPC, commonflags.RPCShorthand, commonflags.RPCDefault, commonflags.RPCUsage)
|
||||||
|
|
||||||
_ = cobra.MarkFlagRequired(createCmd.Flags(), commonflags.WalletPath)
|
_ = cobra.MarkFlagRequired(createCmd.Flags(), commonflags.WalletPath)
|
||||||
|
|
|
@ -27,7 +27,7 @@ func initSGDeleteCmd() {
|
||||||
flags.String(cidFlag, "", "Container ID")
|
flags.String(cidFlag, "", "Container ID")
|
||||||
_ = sgDelCmd.MarkFlagRequired(cidFlag)
|
_ = sgDelCmd.MarkFlagRequired(cidFlag)
|
||||||
|
|
||||||
flags.StringVarP(&sgID, sgIDFlag, "", "", "storage group identifier")
|
flags.StringVarP(&sgID, sgIDFlag, "", "", "Storage group identifier")
|
||||||
_ = sgDelCmd.MarkFlagRequired(sgIDFlag)
|
_ = sgDelCmd.MarkFlagRequired(sgIDFlag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ func initSGGetCmd() {
|
||||||
flags.String(cidFlag, "", "Container ID")
|
flags.String(cidFlag, "", "Container ID")
|
||||||
_ = sgGetCmd.MarkFlagRequired(cidFlag)
|
_ = sgGetCmd.MarkFlagRequired(cidFlag)
|
||||||
|
|
||||||
flags.StringVarP(&sgID, sgIDFlag, "", "", "storage group identifier")
|
flags.StringVarP(&sgID, sgIDFlag, "", "", "Storage group identifier")
|
||||||
_ = sgGetCmd.MarkFlagRequired(sgIDFlag)
|
_ = sgGetCmd.MarkFlagRequired(sgIDFlag)
|
||||||
|
|
||||||
flags.Bool(sgRawFlag, false, "Set raw request option")
|
flags.Bool(sgRawFlag, false, "Set raw request option")
|
||||||
|
|
|
@ -20,10 +20,10 @@ var keyerCmd = &cobra.Command{
|
||||||
var errKeyerSingleArgument = errors.New("pass only one argument at a time")
|
var errKeyerSingleArgument = errors.New("pass only one argument at a time")
|
||||||
|
|
||||||
func initKeyerCmd() {
|
func initKeyerCmd() {
|
||||||
keyerCmd.Flags().BoolP("generate", "g", false, "generate new private key")
|
keyerCmd.Flags().BoolP("generate", "g", false, "Generate new private key")
|
||||||
keyerCmd.Flags().Bool("hex", false, "print all values in hex encoding")
|
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("uncompressed", "u", false, "Use uncompressed public key format")
|
||||||
keyerCmd.Flags().BoolP("multisig", "m", false, "calculate multisig address from public keys")
|
keyerCmd.Flags().BoolP("multisig", "m", false, "Calculate multisig address from public keys")
|
||||||
}
|
}
|
||||||
|
|
||||||
func processKeyer(cmd *cobra.Command, args []string) {
|
func processKeyer(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ var (
|
||||||
|
|
||||||
locodeGenerateCmd = &cobra.Command{
|
locodeGenerateCmd = &cobra.Command{
|
||||||
Use: "generate",
|
Use: "generate",
|
||||||
Short: "generate UN/LOCODE database for NeoFS",
|
Short: "Generate UN/LOCODE database for NeoFS",
|
||||||
Run: func(cmd *cobra.Command, _ []string) {
|
Run: func(cmd *cobra.Command, _ []string) {
|
||||||
locodeDB := csvlocode.New(
|
locodeDB := csvlocode.New(
|
||||||
csvlocode.Prm{
|
csvlocode.Prm{
|
||||||
|
|
|
@ -18,7 +18,7 @@ var (
|
||||||
|
|
||||||
locodeInfoCmd = &cobra.Command{
|
locodeInfoCmd = &cobra.Command{
|
||||||
Use: "info",
|
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) {
|
Run: func(cmd *cobra.Command, _ []string) {
|
||||||
targetDB := locodebolt.New(locodebolt.Prm{
|
targetDB := locodebolt.New(locodebolt.Prm{
|
||||||
Path: locodeInfoDBPath,
|
Path: locodeInfoDBPath,
|
||||||
|
|
|
@ -33,7 +33,7 @@ func entryPoint(cmd *cobra.Command, _ []string) error {
|
||||||
func init() {
|
func init() {
|
||||||
// use stdout as default output for cmd.Print()
|
// use stdout as default output for cmd.Print()
|
||||||
command.SetOut(os.Stdout)
|
command.SetOut(os.Stdout)
|
||||||
command.Flags().Bool("version", false, "application version")
|
command.Flags().Bool("version", false, "Application version")
|
||||||
command.AddCommand(
|
command.AddCommand(
|
||||||
blobovnicza.Root,
|
blobovnicza.Root,
|
||||||
meta.Root,
|
meta.Root,
|
||||||
|
|
|
@ -77,9 +77,9 @@ In this case there is a number of helper functions which can be used:
|
||||||
}
|
}
|
||||||
|
|
||||||
ff := gendocCmd.Flags()
|
ff := gendocCmd.Flags()
|
||||||
ff.StringP(gendocTypeFlag, "t", gendocMarkdown, "type for the documentation ('md' or 'man')")
|
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.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(extensionFlag, "e", "", "If the template is specified, string to append to the output file names")
|
||||||
return gendocCmd
|
return gendocCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue