google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.64k stars 431 forks source link

Provide Available Function Names in clasp run #354

Closed grant closed 6 years ago

grant commented 6 years ago

Expected Behavior

Actual Behavior

We don't use functionSet.

takanakahiko commented 6 years ago

How do we display function names?

example :

  1. switch arg functionName to optional. ( clasp run [functionName] [--nondev] )
  2. If we don't provide a functionName , use Inquirer to list function names.
grant commented 6 years ago

Use inquirer to prompt the user for function names, like we do for create, clone, etc.

  1. clasp run [functionName]
  2. If we don't have the functionName, use inquirer#prompt to get the name. Provide a list of possible names from here: script.projects.getContent#files[N]#functionSet[O]#name (map over all files)
  3. script.run with the name.

Eventually add autocompletion like this: https://www.npmjs.com/package/inquirer-autocomplete-prompt#example inquirer

grant commented 5 years ago

I added fuzzy filtering to the autocompletion. For some reason, the inquirer prompt wasn't quite working when I tried it.

screen shot 2018-11-23 at 15 43 17