Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
Add '--name' flag to 'netlify functions:create'
Browse files Browse the repository at this point in the history
An alternative to passing the first positional argument that
matches the style described in the message returned by
'netlify functions'
  • Loading branch information
Benaiah committed Mar 14, 2019
1 parent 4416a12 commit 18fa9ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/functions/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.handler = async function(event, context) {
class FunctionsCreateCommand extends Command {
async run() {
const { flags, args } = this.parse(FunctionsCreateCommand)
const { name } = args
const name = flags.name || args.name
const { config } = this.netlify

this.log(`Creating function ${name}`)
Expand Down Expand Up @@ -70,6 +70,7 @@ FunctionsCreateCommand.description = `create a new function locally
FunctionsCreateCommand.examples = ['netlify functions:create hello-world']

FunctionsCreateCommand.flags = {
name: flags.string({ char: 'n', description: 'function name' }),
functions: flags.string({ char: 'f', description: 'functions folder' }),
dir: flags.boolean({
char: 'd',
Expand Down

0 comments on commit 18fa9ac

Please sign in to comment.