-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: print help without title for doc
- Loading branch information
1 parent
4206539
commit dbd02d1
Showing
15 changed files
with
348 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {cyan, green, yellow} from 'kleur'; | ||
import {helpMode, helpOutput, TITLE} from './help'; | ||
|
||
export const CLEAR_DESCRIPTION = | ||
'Clear existing dapp code by removing JavaScript, HTML, CSS, and other files from your satellite.'; | ||
|
||
const usage = `Usage: ${green('juno')} ${cyan('clear')} ${yellow('[options]')} | ||
Options: | ||
${yellow('-f, --fullPath')} Clear a particular file of your dapp. | ||
${helpMode} | ||
${yellow('-h, --help')} Output usage information.`; | ||
|
||
const doc = `${CLEAR_DESCRIPTION} | ||
\`\`\`bash | ||
${usage} | ||
\`\`\` | ||
`; | ||
|
||
const help = `${TITLE} | ||
${usage} | ||
`; | ||
|
||
export const logHelpClear = (args?: string[]) => { | ||
console.log(helpOutput(args) === 'doc' ? doc : help); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {cyan, green, yellow} from 'kleur'; | ||
import {helpMode, helpOutput, TITLE} from './help'; | ||
|
||
export const CONFIG_DESCRIPTION = 'Apply configuration to satellite.'; | ||
|
||
const usage = `Usage: ${green('juno')} ${cyan('config')} ${yellow('[options]')} | ||
Options: | ||
${helpMode} | ||
${yellow('-h, --help')} Output usage information.`; | ||
|
||
const doc = `${CONFIG_DESCRIPTION} | ||
\`\`\`bash | ||
${usage} | ||
\`\`\` | ||
`; | ||
|
||
const help = `${TITLE} | ||
${usage} | ||
`; | ||
|
||
export const logHelpConfig = (args?: string[]) => { | ||
console.log(helpOutput(args) === 'doc' ? doc : help); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import {cyan, green, yellow} from 'kleur'; | ||
import {helpMode, helpOutput, TITLE} from './help'; | ||
|
||
export const DEPLOY_DESCRIPTION = 'Deploy your dapp to your satellite.'; | ||
|
||
const usage = `Usage: ${green('juno')} ${cyan('deploy')} ${yellow('[options]')} | ||
Options: | ||
${yellow('-c, --clear')} Clear existing dapp files before proceeding with deployment. | ||
${helpMode} | ||
${yellow('-h, --help')} Output usage information.`; | ||
|
||
const doc = `${DEPLOY_DESCRIPTION} | ||
\`\`\`bash | ||
${usage} | ||
\`\`\` | ||
`; | ||
|
||
const help = `${TITLE} | ||
${usage} | ||
`; | ||
|
||
export const logHelpDeploy = (args?: string[]) => { | ||
console.log(helpOutput(args) === 'doc' ? doc : help); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import {cyan, green, magenta} from 'kleur'; | ||
import {helpOutput, TITLE} from './help'; | ||
|
||
export const DEV_DESCRIPTION = | ||
'Handle development-related tasks such as building and deploying locally using Cargo and Docker.'; | ||
|
||
const helpDevBuild = `${magenta('build')} Compile satellite features using Cargo.`; | ||
const helpDevStart = `${magenta( | ||
'start' | ||
)} Start a local Internet Computer network, encapsulated in a Docker environment.`; | ||
|
||
export const helpDevContinue = `${helpDevBuild} | ||
${helpDevStart}`; | ||
|
||
const usage = `Usage: ${green('juno')} ${cyan('dev')} ${magenta('<subcommand>')} | ||
Subcommands: | ||
${helpDevBuild} | ||
${magenta( | ||
'eject' | ||
)} Create a Rust template for custom satellite feature hooks and extensions. | ||
${helpDevStart} | ||
${magenta('stop')} Stop the Docker environment.`; | ||
|
||
const doc = `${DEV_DESCRIPTION} | ||
\`\`\`bash | ||
${usage} | ||
\`\`\` | ||
`; | ||
|
||
const help = `${TITLE} | ||
${usage} | ||
`; | ||
|
||
export const logHelpDev = (args?: string[]) => { | ||
console.log(helpOutput(args) === 'doc' ? doc : help); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import {cyan, green, yellow} from 'kleur'; | ||
import {helpMode, helpOutput, TITLE} from './help'; | ||
|
||
const usage = ( | ||
command: string | ||
): string => `Usage: ${green('juno')} ${cyan(command)} ${yellow('[options]')} | ||
Options: | ||
${yellow('-h, --help')} Output usage information.`; | ||
|
||
const help = (command: string) => `${TITLE} | ||
${usage(command)} | ||
`; | ||
|
||
const helpWithMode = (command: string) => `${TITLE} | ||
${usage(command)} | ||
${helpMode} | ||
`; | ||
|
||
const doc = (command: string) => `\`\`\`bash | ||
${usage(command)} | ||
\`\`\` | ||
`; | ||
|
||
const docWithMode = (command: string) => `\`\`\`bash | ||
${usage(command)} | ||
${helpMode} | ||
\`\`\` | ||
`; | ||
|
||
export const logHelp = ({args, command}: {args?: string[]; command: string}) => { | ||
console.log(helpOutput(args) === 'doc' ? doc(command) : help(command)); | ||
}; | ||
|
||
export const logHelpWithMode = ({args, command}: {args?: string[]; command: string}) => { | ||
console.log(helpOutput(args) === 'doc' ? docWithMode(command) : helpWithMode(command)); | ||
}; |
Oops, something went wrong.