Chapel: Specify brick name in mason {new, init}

Created on 21 Feb 2020  路  11Comments  路  Source: chapel-lang/chapel

Follow-on to https://github.com/chapel-lang/chapel/issues/7961:

This feature request is to support mason new --moduleName to differentiate the directory name and the module name. For example:

mason new illegal-module-name --moduleName LegalModuleName

This could also be supported in mason init when that is supported (https://github.com/chapel-lang/chapel/pull/14820). This should generate an error if running mason init in project with an existing brick name.

I see the tasks for this issue as:

  1. Add the 鈥攎oduleName flag to mason new (and mason init when that is merged)
  2. Update the warning for when a user specifies an illegal name in mason new <name> to suggest using 鈥攎oduleName
  3. Update the help output and documentation

We may consider alternatives to --moduleName, such as--name, --brickName, --projectName, ...

Tools Feature Request

Most helpful comment

:+1: to vote for --name

All 11 comments

@ben-albrecht I think we should stick to --moduleName as its purpose is to simply change the module name of the library project. I'm working on it 馃憤
Also , shouldn't there be an '=' in the command as in --moduleName=LegalModuleName ?

I think it should support both. I checked and mason build --example, and think that should be extended as well to support both styles as well:

# This works:
mason build --example foo
# This is an error:
mason build --example=foo

-- moduleName=LegalModuleName

I don't think we should support a space between -- and the flag name (assuming that space was intentional in your example).

I don't think we should support a space between -- and the flag name (assuming that space was intentional in your example).

@ben-albrecht oops, that was unintentional, what I meant to ask is that should we support both
--moduleName=foo and --moduleName foo or either of them ?

yes, both. I have opened https://github.com/chapel-lang/chapel/issues/14989 to document the broader inconsistencies in mason.

I am requesting input from other Chapel developers on naming this flag, which lets the user specify a mason package name that differs from the directory name in mason new (and mason init)

Options include:

  1. mason new foo-bar --moduleName=FooBar

    • specific

    • originally proposed by @bryantlam in the suggestion that led to this feature (comment)

  2. mason new foo-bar --name=FooBar

    • concise

  3. mason new foo-bar --projectName=FooBar

    • specific

    • arguably more accurate, since it impacts the module name _and_ the mason package name

For reference, the current mason new options are:

Usage:
    mason new [options] <project name>

Options:
    -h, --help                   Display this message
        --show                   Increase verbosity
        --no-vcs                 Do not initialize a git repository

:+1: to vote for --moduleName

:+1: to vote for --name

:+1: to vote for --projectName

I don't have a strong opinion, but other options like --brickName or --packageName could be considered more specific depending on how you define brick and/or package in the future.

@ben-albrecht I think we should proceed with --name since it got max votes 馃憤

@ben-albrecht I think we should proceed with --name since it got max votes 馃憤

@ankingcodes Sounds good!

Was this page helpful?
0 / 5 - 0 ratings