diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 6cc5bae..9fe7331 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -1,8 +1,8 @@ import {red} from 'kleur'; +import {logHelpDev} from '../help/dev.help'; import {build} from '../services/build.services'; import {start, stop} from '../services/docker.services'; import {eject} from '../services/eject.services'; -import {helpDev} from './help'; export const dev = async (args?: string[]) => { const [subCommand] = args ?? []; @@ -22,6 +22,6 @@ export const dev = async (args?: string[]) => { break; default: console.log(`${red('Unknown subcommand.')}`); - console.log(helpDev); + logHelpDev(); } }; diff --git a/src/commands/help.ts b/src/commands/help.ts deleted file mode 100644 index 5793fc4..0000000 --- a/src/commands/help.ts +++ /dev/null @@ -1,159 +0,0 @@ -import {cyan, green, grey, magenta, yellow} from 'kleur'; -import {version} from '../../package.json'; - -const JUNO_LOGO = ` __ __ __ __ _ ____ -__) || | || \\| |/ \\ -\\___/ \\___/ |_|\\__|\\____/`; - -const TITLE = `${JUNO_LOGO} CLI ${grey(`v${version}`)}`; - -export const help = ` -${TITLE} - - -Usage: ${green('juno')} ${cyan('')} - -Commands: - ${cyan( - 'clear' - )} Clear existing dapp code by removing JavaScript, HTML, CSS, and other files from your satellite. - ${cyan('config')} Apply configuration to satellite. - ${cyan('deploy')} Deploy your dapp to your satellite. - ${cyan( - 'dev' - )} Handle development-related tasks such as building and deploying locally using Cargo and Docker. - ${cyan('init')} Configure the current directory as a satellite. - ${cyan('help')} Display help information. - ${cyan('login')} Generate an authentication for use in non-interactive environments. - ${cyan('logout')} Log out of the current device using the CLI. - ${cyan('open')} Open your satellite in your browser. - ${cyan('upgrade')} Upgrade your satellite to a specific version code. - ${cyan('use')} Switch between multiple profiles. - ${cyan('version')} Check the version of a satellite, mission control and cli. - ${cyan('whoami')} Display the current controller. - -Options: - ${grey('--headless')} Run the CLI in non-interactive mode (enabled automatically if JUNO_TOKEN is set). -`; - -export const helpMode = `${yellow('-m, --mode')} Set env mode. For example production or a custom string. Default is production.`; - -export const helpUpgrade = ` -${TITLE} - -Usage: ${green('juno')} ${cyan('upgrade')} ${yellow('[options]')} - -Options: - ${yellow('-t, --target')} What type of segment should be upgraded. Valid targets are ${magenta('satellite')}, ${magenta('mission-control')} or ${magenta('orbiter')}. - ${yellow('-s, --src')} A local gzipped wasm file for the upgrade. - ${yellow('-r, --reset')} Reset to the initial state. - ${yellow('-n, --nocheck')} Skip assertions and execute upgrade without prompts. - ${helpMode} - ${yellow('-h, --help')} Output usage information. - -Notes: - -- Resetting a mission control is not possible. -- Disabling checks bypasses the verification of the target hash and skips the validation for build types. -- Targets can be shortened to ${magenta('s')} for satellite, ${magenta('m')} for mission-control and ${magenta('o')} for orbiter. -`; - -export const helpCommand = (command: string) => ` -${TITLE} - -Usage: ${green('juno')} ${cyan(command)} ${yellow('[options]')} - -Options: - ${yellow('-h, --help')} Output usage information. -`; - -export const helpCommandWithMode = (command: string) => ` -${helpCommand(command)} ${helpMode} -`; - -export const helpLogin = ` -${TITLE} - -Usage: ${green('juno')} ${cyan('login')} ${yellow('[options]')} - -Options: - ${yellow('-b, --browser')} A particular browser to open. supported: chrome|firefox|edge. - ${yellow('-h, --help')} Output usage information. -`; - -export const helpUse = ` -${TITLE} - -Usage: ${green('juno')} ${cyan('use')} ${yellow('[options]')} - -Options: - ${yellow('-p, --profile')} The profile that should be use. - ${yellow('-l, --list')} What are the available profiles. - ${yellow('-h, --help')} Output usage information. -`; - -export const helpOpen = ` -${TITLE} - -Usage: ${green('juno')} ${cyan('open')} ${yellow('[options]')} - -Options: - ${yellow('-b, --browser')} A particular browser to open. supported: chrome|firefox|edge. - ${yellow('-c, --console')} Open satellite in the console. - ${helpMode} - ${yellow('-h, --help')} Output usage information. -`; - -export const helpDeploy = ` -${TITLE} - -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. -`; - -export const helpClear = ` -${TITLE} - -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. -`; - -export const helpConfig = ` -${TITLE} - -Usage: ${green('juno')} ${cyan('config')} ${yellow('[options]')} - -Options: - ${helpMode} - ${yellow('-h, --help')} Output usage information. -`; - -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}`; - -export const helpDev = ` -${TITLE} - -Usage: ${green('juno')} ${cyan('dev')} ${magenta('')} - -Subcommands: - ${helpDevBuild} - ${magenta( - 'eject' - )} Create a Rust template for custom satellite feature hooks and extensions. - ${helpDevStart} - ${magenta('stop')} Stop the Docker environment. -`; diff --git a/src/commands/upgrade.ts b/src/commands/upgrade.ts index 296b731..c0f7012 100644 --- a/src/commands/upgrade.ts +++ b/src/commands/upgrade.ts @@ -1,9 +1,9 @@ import {nextArg} from '@junobuild/cli-tools'; import {red} from 'kleur'; +import {logHelpUpgrade} from '../help/upgrade.help'; import {upgradeMissionControl} from '../services/upgrade/upgrade.mission-control.services'; import {upgradeOrbiters} from '../services/upgrade/upgrade.orbiter.services'; import {upgradeSatellite} from '../services/upgrade/upgrade.satellite.services'; -import {helpUpgrade} from './help'; export const upgrade = async (args?: string[]) => { const target = nextArg({args, option: '-t'}) ?? nextArg({args, option: '--target'}); @@ -23,6 +23,6 @@ export const upgrade = async (args?: string[]) => { break; default: console.log(`${red('Unknown target.')}`); - console.log(helpUpgrade); + logHelpUpgrade(); } }; diff --git a/src/help/clear.help.ts b/src/help/clear.help.ts new file mode 100644 index 0000000..33ad982 --- /dev/null +++ b/src/help/clear.help.ts @@ -0,0 +1,31 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpMode, helpOutput} from './common.help'; +import {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} + +${CLEAR_DESCRIPTION} + +${usage} +`; + +export const logHelpClear = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/common.help.ts b/src/help/common.help.ts new file mode 100644 index 0000000..1c2fcae --- /dev/null +++ b/src/help/common.help.ts @@ -0,0 +1,7 @@ +import {hasArgs} from '@junobuild/cli-tools'; +import {yellow} from 'kleur'; + +export const helpMode = `${yellow('-m, --mode')} Set env mode. For example production or a custom string. Default is production.`; + +export const helpOutput = (args?: string[]): 'doc' | 'cli' => + hasArgs({args, options: ['-d', '--doc']}) ? 'doc' : 'cli'; diff --git a/src/help/config.help.ts b/src/help/config.help.ts new file mode 100644 index 0000000..8480d61 --- /dev/null +++ b/src/help/config.help.ts @@ -0,0 +1,29 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpMode, helpOutput} from './common.help'; +import {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} + +${CONFIG_DESCRIPTION} + +${usage} +`; + +export const logHelpConfig = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/deploy.help.ts b/src/help/deploy.help.ts new file mode 100644 index 0000000..112598a --- /dev/null +++ b/src/help/deploy.help.ts @@ -0,0 +1,30 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpMode, helpOutput} from './common.help'; +import {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} + +${DEPLOY_DESCRIPTION} + +${usage} +`; + +export const logHelpDeploy = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/dev.help.ts b/src/help/dev.help.ts new file mode 100644 index 0000000..8227489 --- /dev/null +++ b/src/help/dev.help.ts @@ -0,0 +1,42 @@ +import {cyan, green, magenta} from 'kleur'; +import {helpOutput} from './common.help'; +import {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('')} + +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} + +${DEV_DESCRIPTION} + +${usage} +`; + +export const logHelpDev = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/generic.help.ts b/src/help/generic.help.ts new file mode 100644 index 0000000..bdbb903 --- /dev/null +++ b/src/help/generic.help.ts @@ -0,0 +1,68 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpMode, helpOutput} from './common.help'; +import {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, description}: {command: string; description: string}) => `${TITLE} + +${description} + +${usage(command)} +`; + +const helpWithMode = ({command, description}: {command: string; description: string}) => `${TITLE} + +${description} + +${usage(command)} + ${helpMode} +`; + +const doc = ({command, description}: {command: string; description: string}) => `${description} + +\`\`\`bash +${usage(command)} +\`\`\` +`; + +const docWithMode = ({ + command, + description +}: { + command: string; + description: string; +}) => `${description} + +\`\`\`bash +${usage(command)} + ${helpMode} +\`\`\` +`; + +export const logHelp = ({ + args, + ...rest +}: { + args?: string[]; + command: string; + description: string; +}) => { + console.log(helpOutput(args) === 'doc' ? doc(rest) : help(rest)); +}; + +export const logHelpWithMode = ({ + args, + ...rest +}: { + args?: string[]; + command: string; + description: string; +}) => { + console.log(helpOutput(args) === 'doc' ? docWithMode(rest) : helpWithMode(rest)); +}; diff --git a/src/help/help.ts b/src/help/help.ts new file mode 100644 index 0000000..4e670a8 --- /dev/null +++ b/src/help/help.ts @@ -0,0 +1,45 @@ +import {cyan, green, grey} from 'kleur'; +import {version} from '../../package.json'; +import {CLEAR_DESCRIPTION} from './clear.help'; +import {CONFIG_DESCRIPTION} from './config.help'; +import {DEPLOY_DESCRIPTION} from './deploy.help'; +import {DEV_DESCRIPTION} from './dev.help'; +import {INIT_DESCRIPTION} from './init.help'; +import {LOGIN_DESCRIPTION} from './login.help'; +import {LOGOUT_DESCRIPTION} from './logout.help'; +import {OPEN_DESCRIPTION} from './open.help'; +import {UPGRADE_DESCRIPTION} from './upgrade.help'; +import {USE_DESCRIPTION} from './use.help'; +import {VERSION_DESCRIPTION} from './version.help'; +import {WHOAMI_DESCRIPTION} from './whoami.help'; + +const JUNO_LOGO = ` __ __ __ __ _ ____ +__) || | || \\| |/ \\ +\\___/ \\___/ |_|\\__|\\____/`; + +export const TITLE = `${JUNO_LOGO} CLI ${grey(`v${version}`)}`; + +export const help = ` +${TITLE} + + +Usage: ${green('juno')} ${cyan('')} + +Commands: + ${cyan('clear')} ${CLEAR_DESCRIPTION} + ${cyan('config')} ${CONFIG_DESCRIPTION} + ${cyan('deploy')} ${DEPLOY_DESCRIPTION} + ${cyan('dev')} ${DEV_DESCRIPTION} + ${cyan('init')} ${INIT_DESCRIPTION} + ${cyan('help')} Display help information. + ${cyan('login')} ${LOGIN_DESCRIPTION} + ${cyan('logout')} ${LOGOUT_DESCRIPTION} + ${cyan('open')} ${OPEN_DESCRIPTION} + ${cyan('upgrade')} ${UPGRADE_DESCRIPTION} + ${cyan('use')} ${USE_DESCRIPTION} + ${cyan('version')} ${VERSION_DESCRIPTION} + ${cyan('whoami')} ${WHOAMI_DESCRIPTION} + +Options: + ${grey('--headless')} Run the CLI in non-interactive mode (enabled automatically if JUNO_TOKEN is set). +`; diff --git a/src/help/init.help.ts b/src/help/init.help.ts new file mode 100644 index 0000000..dbaf32a --- /dev/null +++ b/src/help/init.help.ts @@ -0,0 +1,7 @@ +import {logHelp} from './generic.help'; + +export const INIT_DESCRIPTION = 'Set up the project as a Satellite.'; + +export const logHelpInit = (args?: string[]) => { + logHelp({args, command: 'init', description: INIT_DESCRIPTION}); +}; diff --git a/src/help/login.help.ts b/src/help/login.help.ts new file mode 100644 index 0000000..dab92b9 --- /dev/null +++ b/src/help/login.help.ts @@ -0,0 +1,30 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpOutput} from './common.help'; +import {TITLE} from './help'; + +export const LOGIN_DESCRIPTION = + 'Generate an authentication for use in non-interactive environments.'; + +const usage = `Usage: ${green('juno')} ${cyan('login')} ${yellow('[options]')} + +Options: + ${yellow('-b, --browser')} A particular browser to open. supported: chrome|firefox|edge. + ${yellow('-h, --help')} Output usage information.`; + +const doc = `${LOGIN_DESCRIPTION} + +\`\`\`bash +${usage} +\`\`\` +`; + +const help = `${TITLE} + +${LOGIN_DESCRIPTION} + +${usage} +`; + +export const logHelpLogin = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/logout.help.ts b/src/help/logout.help.ts new file mode 100644 index 0000000..20e6acb --- /dev/null +++ b/src/help/logout.help.ts @@ -0,0 +1,8 @@ +import {logHelp} from './generic.help'; + +export const LOGOUT_DESCRIPTION = + 'Log out of the current device. ⚠️ This action does not remove controllers from the module.'; + +export const logHelpLogout = (args?: string[]) => { + logHelp({args, command: 'logout', description: LOGOUT_DESCRIPTION}); +}; diff --git a/src/help/open.help.ts b/src/help/open.help.ts new file mode 100644 index 0000000..7d636ee --- /dev/null +++ b/src/help/open.help.ts @@ -0,0 +1,31 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpMode, helpOutput} from './common.help'; +import {TITLE} from './help'; + +export const OPEN_DESCRIPTION = 'Open your satellite in your browser.'; + +const usage = `Usage: ${green('juno')} ${cyan('open')} ${yellow('[options]')} + +Options: + ${yellow('-b, --browser')} A particular browser to open. supported: chrome|firefox|edge. + ${yellow('-c, --console')} Open satellite in the console. + ${helpMode} + ${yellow('-h, --help')} Output usage information.`; + +const doc = `${OPEN_DESCRIPTION} + +\`\`\`bash +${usage} +\`\`\` +`; + +const help = `${TITLE} + +${OPEN_DESCRIPTION} + +${usage} +`; + +export const logHelpOpen = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/upgrade.help.ts b/src/help/upgrade.help.ts new file mode 100644 index 0000000..ddda72e --- /dev/null +++ b/src/help/upgrade.help.ts @@ -0,0 +1,39 @@ +import {cyan, green, magenta, yellow} from 'kleur'; +import {helpMode, helpOutput} from './common.help'; +import {TITLE} from './help'; + +export const UPGRADE_DESCRIPTION = 'Upgrade your satellite to a specific version code.'; + +const usage = `Usage: ${green('juno')} ${cyan('upgrade')} ${yellow('[options]')} + +Options: + ${yellow('-t, --target')} What type of segment should be upgraded. Valid targets are ${magenta('satellite')}, ${magenta('mission-control')} or ${magenta('orbiter')}. + ${yellow('-s, --src')} A local gzipped wasm file for the upgrade. + ${yellow('-r, --reset')} Reset to the initial state. + ${yellow('-n, --nocheck')} Skip assertions and execute upgrade without prompts. + ${helpMode} + ${yellow('-h, --help')} Output usage information. + +Notes: + +- Resetting a mission control is not possible. +- Disabling checks bypasses the verification of the target hash and skips the validation for build types. +- Targets can be shortened to ${magenta('s')} for satellite, ${magenta('m')} for mission-control and ${magenta('o')} for orbiter.`; + +const doc = `${UPGRADE_DESCRIPTION} + +\`\`\`bash +${usage} +\`\`\` +`; + +const help = `${TITLE} + +${UPGRADE_DESCRIPTION} + +${usage} +`; + +export const logHelpUpgrade = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/use.help.ts b/src/help/use.help.ts new file mode 100644 index 0000000..d227497 --- /dev/null +++ b/src/help/use.help.ts @@ -0,0 +1,30 @@ +import {cyan, green, yellow} from 'kleur'; +import {helpOutput} from './common.help'; +import {TITLE} from './help'; + +export const USE_DESCRIPTION = 'Switch between multiple profiles.'; + +const usage = `Usage: ${green('juno')} ${cyan('use')} ${yellow('[options]')} + +Options: + ${yellow('-p, --profile')} The profile that should be use. + ${yellow('-l, --list')} What are the available profiles. + ${yellow('-h, --help')} Output usage information.`; + +const doc = `${USE_DESCRIPTION} + +\`\`\`bash +${usage} +\`\`\` +`; + +const help = `${TITLE} + +${USE_DESCRIPTION} + +${usage} +`; + +export const logHelpUse = (args?: string[]) => { + console.log(helpOutput(args) === 'doc' ? doc : help); +}; diff --git a/src/help/version.help.ts b/src/help/version.help.ts new file mode 100644 index 0000000..a00d3d6 --- /dev/null +++ b/src/help/version.help.ts @@ -0,0 +1,7 @@ +import {logHelpWithMode} from './generic.help'; + +export const VERSION_DESCRIPTION = 'Check the version of the modules and cli.'; + +export const logHelpVersion = (args?: string[]) => { + logHelpWithMode({args, command: 'version', description: VERSION_DESCRIPTION}); +}; diff --git a/src/help/whoami.help.ts b/src/help/whoami.help.ts new file mode 100644 index 0000000..ffc006b --- /dev/null +++ b/src/help/whoami.help.ts @@ -0,0 +1,8 @@ +import {logHelpWithMode} from './generic.help'; + +export const WHOAMI_DESCRIPTION = + 'Display your current profile, controller, and links to your satellite.'; + +export const logHelpWhoAmI = (args?: string[]) => { + logHelpWithMode({args, command: 'whoami', description: WHOAMI_DESCRIPTION}); +}; diff --git a/src/index.ts b/src/index.ts index 951da01..f018dc8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,25 +5,25 @@ import {clear} from './commands/clear'; import {config} from './commands/config'; import {deploy} from './commands/deploy'; import {dev} from './commands/dev'; -import { - help, - helpClear, - helpCommand, - helpCommandWithMode, - helpConfig, - helpDeploy, - helpDev, - helpLogin, - helpOpen, - helpUpgrade, - helpUse -} from './commands/help'; import {init} from './commands/init'; import {open} from './commands/open'; import {upgrade} from './commands/upgrade'; import {use} from './commands/use'; import {version as versionCommand} from './commands/version'; import {whoami} from './commands/whoami'; +import {logHelpClear} from './help/clear.help'; +import {logHelpConfig} from './help/config.help'; +import {logHelpDeploy} from './help/deploy.help'; +import {logHelpDev} from './help/dev.help'; +import {help} from './help/help'; +import {logHelpInit} from './help/init.help'; +import {logHelpLogin} from './help/login.help'; +import {logHelpLogout} from './help/logout.help'; +import {logHelpOpen} from './help/open.help'; +import {logHelpUpgrade} from './help/upgrade.help'; +import {logHelpUse} from './help/use.help'; +import {logHelpVersion} from './help/version.help'; +import {logHelpWhoAmI} from './help/whoami.help'; import {checkNodeVersion} from './utils/env.utils'; export const run = async () => { @@ -55,35 +55,44 @@ export const run = async () => { if (hasArgs({args, options: ['-h', '--help']})) { switch (cmd) { case 'login': - console.log(helpLogin); + logHelpLogin(args); break; case 'upgrade': - console.log(helpUpgrade); + logHelpUpgrade(args); break; case 'open': - console.log(helpOpen); + logHelpOpen(args); break; case 'use': - console.log(helpUse); + logHelpUse(args); break; case 'clear': - console.log(helpClear); + logHelpClear(args); break; case 'config': - console.log(helpConfig); + logHelpConfig(args); break; case 'deploy': - console.log(helpDeploy); + logHelpDeploy(args); break; case 'dev': - console.log(helpDev); + logHelpDev(args); + break; + case 'init': + logHelpInit(args); + break; + case 'logout': + logHelpLogout(args); break; case 'version': + logHelpVersion(args); + break; case 'whoami': - console.log(helpCommandWithMode(cmd)); + logHelpWhoAmI(args); break; default: - console.log(helpCommand(cmd)); + console.log(`${red('Unknown command.')}`); + console.log(help); } return; } diff --git a/src/services/eject.services.ts b/src/services/eject.services.ts index 7b6c5ed..633d746 100644 --- a/src/services/eject.services.ts +++ b/src/services/eject.services.ts @@ -1,12 +1,12 @@ import {cyan, green, magenta, yellow} from 'kleur'; import {mkdir} from 'node:fs/promises'; import {join} from 'node:path'; -import {helpDevContinue} from '../commands/help'; import { DEVELOPER_PROJECT_SATELLITE_PATH, TEMPLATE_PATH, TEMPLATE_SATELLITE_PATH } from '../constants/dev.constants'; +import {helpDevContinue} from '../help/dev.help'; import {copySatelliteDid} from '../utils/did.utils'; import {checkRustVersion} from '../utils/env.utils'; import {copyTemplateFile} from '../utils/fs.utils';