Skip to content

Commit

Permalink
✨ Adding new commands and hiding less frequently used commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed May 9, 2024
1 parent a1e34a0 commit 5f678eb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/cli.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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('| |_) / _` | |/ / _ \\')}
Expand All @@ -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();
Expand Down

0 comments on commit 5f678eb

Please sign in to comment.