diff --git a/doc/rst/tools/mason/guide/basicusage.rst b/doc/rst/tools/mason/guide/basicusage.rst index 58c460553aff..52bb5bf1a2ad 100644 --- a/doc/rst/tools/mason/guide/basicusage.rst +++ b/doc/rst/tools/mason/guide/basicusage.rst @@ -14,8 +14,7 @@ To initialize a new mason package, run ``mason new``. The same can also be done cd newPackage mason init - -This starts an interactive session which walks a user through the process of creating a project using Mason. This is highly recommended for new users. +This sets up a folder to have the structure of a mason package. Particularly, it creates a `Mason.toml` file and the `src` folder with the package main module. A more advanced user may use the ``mason new [ options ] `` command, for example:: diff --git a/tools/mason/MasonHelp.chpl b/tools/mason/MasonHelp.chpl index 7de7b9e7b07d..9b0dd4cd4edd 100644 --- a/tools/mason/MasonHelp.chpl +++ b/tools/mason/MasonHelp.chpl @@ -252,7 +252,6 @@ proc masonBuildHelp() { proc masonNewHelp() { writeln('Usage:'); writeln(' mason new [options] '); - writeln(' mason new Starts an interactive session'); writeln(); writeln('Options:'); writeln(' -h, --help Display this message'); diff --git a/tools/mason/MasonNew.chpl b/tools/mason/MasonNew.chpl index f2f1b655fdf7..b58049281896 100644 --- a/tools/mason/MasonNew.chpl +++ b/tools/mason/MasonNew.chpl @@ -99,121 +99,6 @@ proc masonNew(args: [] string) throws { } } -/* - Starts an interactive session to create a - new library project. -*/ -proc beginInteractiveSession(defaultPackageName: string, defVer: string, - defChplVer: string, license: string) throws { - writeln("""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. Suggestions for defaults are also provided which will be -considered if no input is given."""); - writeln(); - writeln("Press ^C to quit interactive mode."); - var packageName: string; - var defPackageName: string = defaultPackageName; - var version: string; - var defaultVersion = if defVer == '' then "0.1.0" else defVer; - var chapelVersion: string; - var currChapelVersion = if defChplVer == '' then getChapelVersionStr() else defChplVer; - var defaultLicense = if license == '' then "None" else license; - var currLicense: string; - var gotCorrectPackageName = false; - var gotCorrectPackageVersion = false; - var gotCorrectChapelVersion = false; - var gotCorrectLicense = false; - while(1){ - try { - if !gotCorrectPackageName { - write("Package name"); - if defPackageName != '' then write(" (" + defPackageName + ")"); - write(": "); - IO.stdout.flush(); - IO.stdin.readLine(packageName); - exitOnEOF(packageName); - packageName = packageName.strip(); - if packageName == '' then - packageName = defPackageName; - var isIllegalName: bool = false; - if !isIdentifier(packageName) { - isIllegalName = true; - throw new owned MasonError("Bad package name '"+ packageName + "' - only Chapel" + - " identifiers are legal package names."); - } - if !isIllegalName { - if isDir('./' + packageName) then - throw new owned MasonError("Bad package name. A package with the name '" - + packageName + "' already exists."); - if validatePackageName(packageName) then - gotCorrectPackageName = true; - } - } - if !gotCorrectPackageVersion { - write("Package version (" + defaultVersion + "): "); - IO.stdout.flush(); - IO.stdin.readLine(version); - exitOnEOF(version); - version = version.strip(); - if version == "" then version = defaultVersion; - checkVersion(version); - gotCorrectPackageVersion = true; - } - if !gotCorrectChapelVersion { - write("Chapel version (" + currChapelVersion + "): "); - IO.stdout.flush(); - IO.stdin.readLine(chapelVersion); - exitOnEOF(chapelVersion); - chapelVersion = chapelVersion.strip(); - if chapelVersion == "" then chapelVersion = currChapelVersion; - if chapelVersion == currChapelVersion then gotCorrectChapelVersion = true; - else if validateChplVersion(chapelVersion) - then gotCorrectChapelVersion = true; - } - if !gotCorrectLicense { - write("License (" + defaultLicense + "): "); - IO.stdout.flush(); - IO.stdin.readLine(currLicense); - exitOnEOF(currLicense); - currLicense = currLicense.strip(); - if currLicense == "" then currLicense = defaultLicense; - gotCorrectLicense = true; - } - if gotCorrectPackageName && - gotCorrectPackageVersion && - gotCorrectChapelVersion && - gotCorrectLicense { - previewMasonFile(packageName, version, chapelVersion, currLicense); - writeln(); - write("Is this okay ? (Y/N): "); - IO.stdout.flush(); - var option: string; - IO.stdin.readLine(option); - exitOnEOF(option); - option = option.strip(); - option = option.toUpper(); - if option == "Y" then break; - if option == "N" then { - gotCorrectChapelVersion = false; - gotCorrectPackageName = false; - gotCorrectPackageVersion = false; - gotCorrectLicense = false; - defaultVersion = version; - currChapelVersion = chapelVersion; - defPackageName = packageName; - defaultLicense = currLicense; - continue; - } - } - } - catch e: MasonError { - writeln(e.message()); - continue; - } - } - return (packageName, version, chapelVersion, currLicense); -} - /* Exit terminal when CTRL + D is pressed */ proc exitOnEOF(parameter) { if parameter == '' {