✨ Adding new commands and hiding less frequently used commands
This commit is contained in:
12
bin/cli.ts
vendored
12
bin/cli.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { program } from 'commander';
|
||||
import { program, Option } from 'commander';
|
||||
import log from 'loglevel';
|
||||
import packageJson from '../package.json';
|
||||
import BuilderProvider from './builders/BuilderProvider';
|
||||
@@ -10,7 +10,7 @@ import handleInputOptions from './options/index';
|
||||
import { PakeCliOptions } from './types';
|
||||
import { validateNumberInput, validateUrlInput } from './utils/validate';
|
||||
|
||||
const { green, yellow }= chalk;
|
||||
const { green, yellow } = chalk;
|
||||
const logo = `${chalk.green(' ____ _')}
|
||||
${green('| _ \\ __ _| | _____')}
|
||||
${green('| |_) / _` | |/ / _ \\')}
|
||||
@@ -31,15 +31,17 @@ program
|
||||
.option('--height <number>', 'Window height', validateNumberInput, DEFAULT.height)
|
||||
.option('--transparent', 'Only for Mac, hide title bar', DEFAULT.transparent)
|
||||
.option('--fullscreen', 'Start in full screen', DEFAULT.fullscreen)
|
||||
.option('--user-agent <string>', 'Custom user agent', DEFAULT.userAgent)
|
||||
.option('--show-system-tray', 'Show system tray in app', DEFAULT.showSystemTray)
|
||||
.option('--system-tray-icon <string>', 'Custom system tray icon', DEFAULT.systemTrayIcon)
|
||||
.option('--iter-copy-file', 'Copy files when URL is a local file', DEFAULT.iterCopyFile)
|
||||
.option('--multi-arch', 'Only for Mac, supports both Intel and M1', DEFAULT.multiArch)
|
||||
.option('--targets <string>', 'Only for Linux, option "deb" or "appimage"', DEFAULT.targets)
|
||||
.option('--inject [injects...]', 'Injection of .js or .css Files', DEFAULT.inject)
|
||||
.option('--safe-domain [domains...]', 'Domains that Require Security Configuration"', DEFAULT.safeDomain)
|
||||
.option('--debug', 'Debug mode', DEFAULT.debug)
|
||||
.option('--debug', 'Debug build and more output', DEFAULT.debug)
|
||||
.addOption(new Option('--user-agent <string>', 'Custom user agent').default(DEFAULT.userAgent).hideHelp())
|
||||
.addOption(new Option('--targets <string>', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT.targets).hideHelp())
|
||||
.addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT.alwaysOnTop).hideHelp())
|
||||
.addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts').default(DEFAULT.disabledWebShortcuts).hideHelp())
|
||||
.version(packageJson.version, '-v, --version', 'Output the current version')
|
||||
.action(async (url: string, options: PakeCliOptions) => {
|
||||
await checkUpdateTips();
|
||||
|
||||
Reference in New Issue
Block a user