Chapel: Add `--interactive` option for mason new and mason init

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

In #14820 and #14786, a need for an --interactive tag has been mentioned for mason init and mason new. Using the commands, mason init --interactive or mason new --interactive will start a CLI questionnaire , in which the user will be prompted to input some values for projectName , version, author etc. for their library project. If an user leaves the fields empty, then default values will be taken.

Tools Feature Request

All 11 comments

Before pursuing this implementation, it would be a good idea to sketch out the interactive queries and their order for feedback.

@ben-albrecht When an user types mason init --interactive or mason new --interactive it calls a function which contains the interactive session. The interactive session outputs as follows:

# description of the utility, something like
This is an interactive session to walk you through creating a library project using Mason.
The following queries covers the common items required to create the project. 
It also tries to guess sensible defaults.

Press <somebutton> to quit. 


name (default displayed here) : [user enters name here] 
version (default displayed) : 
chplVersion (default displayed) : 


# Preview for Mason.toml file
[brick] 
name = "packageName"
version = "0.1.0"
chplVersion = "1.21.0"

[dependencies]

Is this OK ? (yes) 
Created library project at path.

Other package managers support fields for author,license, keywords etc. Not sure if we should add those here.

This looks great to me. I might try to make the intro a little more concise, but everything looks good as is.

We support an authors field, so that should be included.

license is a long-standing feature request (should open an issue on that if it does not exist).

Did I miss out on any fields other than author that can be added ?

I think that's all we need for the initial Mason.toml.

@ankingcodes Since it's two weeks ago, I would like to ask that are you still interested in implementing it or have been already working on it? I could also help : )

@Rapiz1 Thanks for your interest ! This issue is part of my GSoC proposal, so you can consider it assigned to me.

@ben-albrecht I'd be taking this up now. If you have any questions on this, let's discuss 馃憤

@ankingcodes - I think we have a good plan in place for you to start implementing this. Thanks for checking!

Okay, what about the license feature mentioned here. Should I include it for now ?

It is not yet a valid field, so lets leave it out until then.

Was this page helpful?
0 / 5 - 0 ratings