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

Consider a different name for Dragonfruit #129

Open
jonsequitur opened this issue Jun 5, 2018 · 5 comments
Open

Consider a different name for Dragonfruit #129

jonsequitur opened this issue Jun 5, 2018 · 5 comments

Comments

@jonsequitur
Copy link
Contributor

No description provided.

@jonsequitur jonsequitur added this to the Initial public preview milestone Jun 5, 2018
@adamskt
Copy link
Contributor

adamskt commented Jun 11, 2018

How about: ArgumentAppModel for DragonFruit and AttributeAppModel for Starfruit?

@wli3 wli3 removed this from the Initial public preview milestone Sep 12, 2018
@tmds
Copy link
Member

tmds commented Nov 8, 2018

Suggestion: The DragonFruit Main is now named Main, it could be named CliMain and the DragonFruit package can have the same name (CliMain).
Perhaps this also solves an ambiguity issue where both the DragonFruit Main and the entrypoint Main take a string[] argument or no arguments.

@jonsequitur
Copy link
Contributor Author

If there's no user-defined strongly-typed Main, then a user-defined Main(string[]) does work.

If the user defines both kinds of Main methods, there'll be a compiler error, which I think is the right behavior. CliMain seems like more of a new concept than the alternate Main. That said, we haven't come up with a convention for subcommands with DragonFruit, but a few ideas have involved method naming, e.g. aligning method names with command names.

Along those lines, the entry point for foo.exe might reasonably be something like:

public static async Task<int> Foo(int something, bool somethingElse)
{
}

@tmds
Copy link
Member

tmds commented Nov 9, 2018

If there's no user-defined strongly-typed Main, then a user-defined Main(string[]) does work. If the user defines both kinds of Main methods, there'll be a compiler error, which I think is the right behavior.

The cases I'm thinking about:

  • the application doesn't accept any options, in that case the strongly-typed Main has a signature: Main()
  • the application accepts an option of type string[], in that case the strongly-typed Main has a signature: Main(string[] args)

In these two cases, the strongly-typed Main has the signature of a valid entry-point Main.
The user can work around it by adding an additional argument (e.g. IConsole).

@iCodeSometime
Copy link

iCodeSometime commented Aug 5, 2020

In addition, choosing an alternate name for the main method of a DragonFruit app (like CliMain) would prevent ambiguous reference problems with other auto-generated main methods, e.g. if the CLI app is actually sometimes a WPF app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants