Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change short option of --tracingConfig to -c #385

Merged
merged 3 commits into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Options:
-g, --vpcSecurityGroups [] Lambda VPC Security Group
-K, --kmsKeyArn [] Lambda KMS Key ARN
-Q, --deadLetterConfigTargetArn [] Lambda DLQ resource
-T, --tracingConfig [] Lambda tracing settings
-c, --tracingConfig [] Lambda tracing settings
-R, --retentionInDays [] CloudWatchLogs retentionInDays settings
-A, --packageDirectory [build] Local Package Directory
-G, --sourceDirectory [] Path to lambda source Directory (e.g. "./some-lambda")
Expand Down
2 changes: 1 addition & 1 deletion bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ program
.option('-K, --kmsKeyArn [' + AWS_KMS_KEY_ARN + ']', 'Lambda KMS Key ARN', AWS_KMS_KEY_ARN)
.option('-Q, --deadLetterConfigTargetArn [' + AWS_DLQ_TARGET_ARN + ']', 'Lambda DLQ resource',
AWS_DLQ_TARGET_ARN)
.option('-T, --tracingConfig [' + AWS_TRACING_CONFIG + ']', 'Lambda tracing settings',
.option('-c, --tracingConfig [' + AWS_TRACING_CONFIG + ']', 'Lambda tracing settings',
AWS_TRACING_CONFIG)
.option('-R, --retentionInDays [' + AWS_LOGS_RETENTION_IN_DAYS + ']', 'CloudWatchLogs retentionInDays settings',
AWS_LOGS_RETENTION_IN_DAYS)
Expand Down
31 changes: 31 additions & 0 deletions test/node-lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,37 @@ describe('bin/node-lambda', () => {
})
})

describe('node-lambda duplicate check of short option', () => {
const duplicateCheckTestFunc = (type, done) => {
const cmd = spawn('node', [nodeLambdaPath, type, '-h'])
let stdoutString = ''
cmd.stdout.on('data', (data) => {
stdoutString += data.toString()
})

cmd.on('exit', (code) => {
assert.equal(code, 0)

const shortOptions = stdoutString.split('\n').filter(line => {
return line.match(/^\s+-/)
}).map(line => {
return line.split(/\s+/)[1]
})
const uniqueShortOptions = shortOptions.filter((option, index, array) => {
return array.indexOf(option) === index
})
assert.equal(shortOptions.length, uniqueShortOptions.length)
done()
})
}

['deploy', 'run', 'setup'].forEach(type => {
it(`cmd:${type}`, (done) => {
duplicateCheckTestFunc(type, done)
})
})
})

describe('node-lambda --version', () => {
const packageJson = require(path.join(__dirname, '..', 'package.json'))
it('The current version is displayed', () => {
Expand Down