From 9d09f74c902e75c7ec1b5d8f93f288f42c535b9a Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Fri, 5 Mar 2021 08:44:30 +0100 Subject: [PATCH] chore(cli-repl): cleanup CLI argument documentation MONGOSH-571 --- README.md | 29 ++++++++++------------------- packages/cli-repl/src/constants.ts | 9 +++++++++ packages/i18n/src/locales/en_US.ts | 11 ++++++----- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a332ec1c2a..a5d491eafe 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,12 @@ variable. For detailed instructions for each of our supported platforms, please $ mongosh [options] [db address] Options: + -h, --help Show this usage information - --ipv6 Enable IPv6 support (disabled by default) --host [arg] Server to connect to --port [arg] Port to connect to --version Show version information - --shell Run the shell after executing files --nodb Don't connect to mongod on startup - no 'db address' [arg] expected - --norc Will not run the '.mongorc.js' file on start up - --eval [arg] Evaluate javascript --retryWrites Automatically retry write operations upon transient network errors Authentication Options: @@ -46,46 +43,40 @@ variable. For detailed instructions for each of our supported platforms, please -p, --password [arg] Password for authentication --authenticationDatabase [arg] User source (defaults to dbname) --authenticationMechanism [arg] Authentication mechanism - --gssapiServiceName [arg] (=mongodb) undefined - --gssapiHostName [arg] Automatically retry write operations upon transient network errors + --awsIamSessionToken [arg] AWS IAM Temporary Session Token ID TLS Options: --tls Use TLS for all connections --tlsCertificateKeyFile [arg] PEM certificate/key file for TLS - --tlsCertificateKeyFilePassword [arg] undefined + --tlsCertificateKeyFilePassword [arg] Password for key in PEM file for TLS --tlsCAFile [arg] Certificate Authority file for TLS - --tlsCRLFile [arg] Certificate Revocation List file for TLS - --tlsAllowInvalidHostnames undefined - --tlsAllowInvalidCertificates undefined + --tlsAllowInvalidHostnames Allow connections to servers with non-matching hostnames + --tlsAllowInvalidCertificates Allow connections to servers with invalid certificates --tlsCertificateSelector [arg] TLS Certificate in system store --tlsDisabledProtocols [arg] Comma separated list of TLS protocols to disable [TLS1_0,TLS1_1,TLS1_2] - FLE AWS Options + FLE Options: --awsAccessKeyId [arg] AWS Access Key for FLE Amazon KMS --awsSecretAccessKey [arg] AWS Secret Key for FLE Amazon KMS --awsSessionToken [arg] Optional AWS Session Token ID --keyVaultNamespace [arg] database.collection to store encrypted FLE parameters - --kmsURL [arg] Test parameter to override the URL for + --kmsURL [arg] Test parameter to override the URL of the KMS endpoint - DB Address Examples + DB Address Examples: foo Foo database on local machine 192.168.0.5/foo Foo database on 192.168.0.5 machine 192.168.0.5:9999/foo Foo database on 192.168.0.5 machine on port 9999 mongodb://192.168.0.5:9999/foo Connection string URI can also be used - File Names - - A list of files to run. Files must end in .js and will exit after unless --shell is specified. - - Examples + Examples: Start mongosh using 'ships' database on specified connection string: $ mongosh mongodb://192.168.0.5:9999/ships - For more information on mongosh usage: https://docs.mongodb.com/manual/mongo/. + For more information on usage: https://docs.mongodb.com/mongodb-shell. ``` ## Releasing diff --git a/packages/cli-repl/src/constants.ts b/packages/cli-repl/src/constants.ts index 39a1e2a8fa..e876167133 100644 --- a/packages/cli-repl/src/constants.ts +++ b/packages/cli-repl/src/constants.ts @@ -31,6 +31,7 @@ export const USAGE = ` -p, --password [arg] ${i18n.__('cli-repl.args.password')} --authenticationDatabase [arg] ${i18n.__('cli-repl.args.authenticationDatabase')} --authenticationMechanism [arg] ${i18n.__('cli-repl.args.authenticationMechanism')} + --awsIamSessionToken [arg] ${i18n.__('cli-repl.args.awsIamSessionToken')} ${clr(i18n.__('cli-repl.args.tlsOptions'), ['bold', 'yellow'])} @@ -43,6 +44,14 @@ export const USAGE = ` --tlsCertificateSelector [arg] ${i18n.__('cli-repl.args.tlsCertificateSelector')} --tlsDisabledProtocols [arg] ${i18n.__('cli-repl.args.tlsDisabledProtocols')} + ${clr(i18n.__('cli-repl.args.fleOptions'), ['bold', 'yellow'])} + + --awsAccessKeyId [arg] ${i18n.__('cli-repl.args.awsAccessKeyId')} + --awsSecretAccessKey [arg] ${i18n.__('cli-repl.args.awsSecretAccessKey')} + --awsSessionToken [arg] ${i18n.__('cli-repl.args.awsSessionToken')} + --keyVaultNamespace [arg] ${i18n.__('cli-repl.args.keyVaultNamespace')} + --kmsURL [arg] ${i18n.__('cli-repl.args.kmsURL')} + ${clr(i18n.__('cli-repl.args.dbAddressOptions'), ['bold', 'yellow'])} foo ${i18n.__('cli-repl.args.dbAddress/foo')} diff --git a/packages/i18n/src/locales/en_US.ts b/packages/i18n/src/locales/en_US.ts index 090fbe28ae..e52ebed493 100644 --- a/packages/i18n/src/locales/en_US.ts +++ b/packages/i18n/src/locales/en_US.ts @@ -25,6 +25,7 @@ const translations: Catalog = { password: 'Password for authentication', authenticationDatabase: 'User source (defaults to dbname)', authenticationMechanism: 'Authentication mechanism', + awsIamSessionToken: 'AWS IAM Temporary Session Token ID', gssapiServiceName: 'Service name to use when authenticating using GSSAPI/Kerberos', gssapiHostName: 'Remote host name to use for purpose of GSSAPI/Kerberos authentication', tlsOptions: 'TLS Options:', @@ -37,20 +38,20 @@ const translations: Catalog = { tlsAllowInvalidCertificates: 'Allow connections to servers with invalid certificates', tlsCertificateSelector: 'TLS Certificate in system store', tlsDisabledProtocols: 'Comma separated list of TLS protocols to disable [TLS1_0,TLS1_1,TLS1_2]', - fleAwsOptions: 'FLE AWS Options', + fleOptions: 'FLE Options:', awsAccessKeyId: 'AWS Access Key for FLE Amazon KMS', awsSecretAccessKey: 'AWS Secret Key for FLE Amazon KMS', awsSessionToken: 'Optional AWS Session Token ID', keyVaultNamespace: 'database.collection to store encrypted FLE parameters', - kmsURL: 'Test parameter to override the URL for', - dbAddressOptions: 'DB Address Examples', + kmsURL: 'Test parameter to override the URL of the KMS endpoint', + dbAddressOptions: 'DB Address Examples:', 'dbAddress/foo': 'Foo database on local machine', 'dbAddress/192/foo': 'Foo database on 192.168.0.5 machine', 'dbAddress/192/host/foo': 'Foo database on 192.168.0.5 machine on port 9999', 'dbAddress/connectionURI': 'Connection string URI can also be used', - fileNames: 'File Names', + fileNames: 'File Names:', filenameDescription: 'A list of files to run. Files must end in .js and will exit after unless --shell is specified.', - examples: 'Examples', + examples: 'Examples:', connectionExampleWithDatabase: "Start mongosh using 'ships' database on specified connection string:", moreInformation: 'For more information on usage:' },