-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for CLI creation of new functions based on order, without explicit naming. #374
Comments
I think the name should be a positional arg, but things like the auth level should be an option (otherwise ordering would need to be defined). The name has precedence with
|
I played around with the Azure Functions CLI implementation (it doesn't seem to support positional args at all) and read this thread. Thoughts:
Also, if no one is else is working on this, I'd like to take it up. |
@ajnirp you are correct! Thanks for offering to take it up; let me know if there's anything I can help with. This should target the |
I was poking around and I'm failing to see changes I made in My workflow is:
Could use some help on this - any idea what I'm doing wrong? |
Hi @ajnirp! When testing out changes to the SDK, you'll need to install the local version using |
Thanks @peterhuene! That worked. If I understand correctly, the problem with not running Re: the issue - I browsed the Clap docs and I think I'm missing something very obvious - how to make an arg act as both a positional arg as well as an option arg. An alternate approach is to make two different args, one positional and one option-style, and specify that one conflicts with the other. This seems hacky, but it works. Here's the relevant code - ajnirp@ca672e8 Is there a specific approach you would suggest? |
That's correct.
I don't think you'll be able to have one argument function as both an option and a positional argument. I think the solution you have that uses two different options will work just fine. |
Resolved with #403. |
Is your feature request related to a problem? Please describe.
The CLI provides a way of creating new Azure Functions following this sample structure:
It may be a useful addition to the user experience to allow for these
name
andauth_level
parameters to be passed in without explicitly naming them, and assigning them based on the order in which they are provided. The following command would produce the same result as the above:Describe alternatives you've considered
All Azure Functions do require a
name
parameter. An alternative design that may be used is to resolve the first arg to always be thename
param and have additional params be explicitly named. i.e.:Additional context
It will be worth looking at how this is implemented in the Azure Functions CLI.
The text was updated successfully, but these errors were encountered: