diff --git a/README.md b/README.md index 237a8b947..7262bee84 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ If you wish to see the raw output from our API in this response, supply the `-- #### Create a new version ```sh -rdme versions:create +rdme versions:create | --version={project-version} ``` ##### Automating this process @@ -114,14 +114,14 @@ If you wish to automate the process of creating a new project version, and not h For example: ```sh -rdme versions:create --fork={version-fork} --codename={version-name} --main --beta +rdme versions:create | --version={project-version} --fork={version-fork} --main={boolean} --beta={boolean} --isPublic={boolean} ``` See `rdme versions:create --help` for a full list of flags. #### Update a version ```sh -rdme versions:update +rdme versions:update --version={project-version} ``` Like `versions:create`, if you wish to automate this process and not be blocked by CLI input, you can supply the necessary flags to this command. See `rdme versions:update --help` or [automating this process](#automating-this-process) for more information. @@ -130,7 +130,7 @@ Like `versions:create`, if you wish to automate this process and not be blocked You can remove a specific version from your project, as well as all of the attached specs ```sh -rdme versions:delete +rdme versions:delete --version={project-version} ``` ### Open your ReadMe project in your browser diff --git a/cmds/versions/create.js b/cmds/versions/create.js index 308755bdf..3b9c5af5d 100644 --- a/cmds/versions/create.js +++ b/cmds/versions/create.js @@ -4,7 +4,7 @@ const { prompt } = require('enquirer'); const promptOpts = require('../../lib/prompts'); exports.command = 'versions:create'; -exports.usage = 'versions:create [options]'; +exports.usage = 'versions:create | --version={project-version} [options]'; exports.description = 'Create a new version for your project.'; exports.category = 'versions'; exports.position = 2; @@ -33,17 +33,17 @@ exports.args = [ }, { name: 'main', - type: Boolean, + type: String, description: 'Should this version be the primary (default) version for your project?', }, { name: 'beta', - type: Boolean, + type: String, description: 'Is this version in beta?', }, { name: 'isPublic', - type: Boolean, + type: String, description: 'Would you like to make this version public? Any primary version must be public.', }, ]; @@ -78,10 +78,12 @@ exports.run = async function(opts) { json: { version, codename: codename || '', - is_stable: main || promptResponse.is_stable, - is_beta: beta || promptResponse.is_beta, + is_stable: main === 'true' || promptResponse.is_stable, + is_beta: beta === 'true' || promptResponse.is_beta, from: fork || promptResponse.from, - is_hidden: promptResponse.is_stable ? false : !(isPublic || promptResponse.is_hidden), + is_hidden: promptResponse.is_stable + ? false + : !(isPublic === 'true' || promptResponse.is_hidden), }, auth: { user: key }, }; diff --git a/cmds/versions/delete.js b/cmds/versions/delete.js index 625fa7344..eddbe2bde 100644 --- a/cmds/versions/delete.js +++ b/cmds/versions/delete.js @@ -2,7 +2,7 @@ const request = require('request-promise-native'); const config = require('config'); exports.command = 'versions:delete'; -exports.usage = 'versions:delete [options]'; +exports.usage = 'versions:delete --version={project-version} [options]'; exports.description = 'Delete a version associated with your ReadMe project.'; exports.category = 'versions'; exports.position = 4; diff --git a/cmds/versions/update.js b/cmds/versions/update.js index f342a7170..7fefddfb3 100644 --- a/cmds/versions/update.js +++ b/cmds/versions/update.js @@ -4,7 +4,7 @@ const { prompt } = require('enquirer'); const promptOpts = require('../../lib/prompts'); exports.command = 'versions:update'; -exports.usage = 'versions:update [options]'; +exports.usage = 'versions:update --version={project-version} [options]'; exports.description = 'Update an existing version for your project.'; exports.category = 'versions'; exports.position = 3; @@ -27,17 +27,17 @@ exports.args = [ }, { name: 'main', - type: Boolean, + type: String, description: 'Should this version be the primary (default) version for your project?', }, { name: 'beta', - type: Boolean, + type: String, description: 'Is this version in beta?', }, { name: 'isPublic', - type: Boolean, + type: String, description: 'Would you like to make this version public? Any primary version must be public.', }, ]; @@ -69,10 +69,12 @@ exports.run = async function(opts) { json: { codename: codename || '', version: newVersion || promptResponse.newVersion, - is_stable: foundVersion.is_stable || main || promptResponse.is_stable, - is_beta: beta || promptResponse.is_beta, + is_stable: foundVersion.is_stable || main === 'true' || promptResponse.is_stable, + is_beta: beta === 'true' || promptResponse.is_beta, is_deprecated: deprecated || promptResponse.is_deprecated, - is_hidden: promptResponse.is_stable ? false : !(isPublic || promptResponse.is_hidden), + is_hidden: promptResponse.is_stable + ? false + : !(isPublic === 'true' || promptResponse.is_hidden), }, auth: { user: key }, };