Skip to content
Tauri 中文网

@tauri-apps/plugin-cli

Parse arguments from your Command Line Interface.

2.0.0

PropertyTypeDescriptionDefined in
occurrencesnumberNumber of occurrencesSource: undefined
valuenull | string | boolean | string[]string if takes value boolean if flag string[] or null if takes multiple valuesSource: undefined

2.0.0

PropertyTypeDefined in
argsRecord<string, ArgMatch>Source: undefined
subcommandnull | SubcommandMatchSource: undefined

2.0.0

PropertyTypeDefined in
matchesCliMatchesSource: undefined
namestringSource: undefined

function getMatches(): Promise<CliMatches>

Parse the arguments provided to the current process and get the matches using the configuration defined tauri.cli in tauri.conf.json

Promise<CliMatches>

import { getMatches } from '@tauri-apps/plugin-cli';
const matches = await getMatches();
if (matches.subcommand?.name === 'run') {
// `./your-app run $ARGS` was executed
const args = matches.subcommand?.matches.args
if ('debug' in args) {
// `./your-app run --debug` was executed
}
} else {
const args = matches.args
// `./your-app $ARGS` was executed
}

2.0.0

Source: undefined


Tauri v2.8 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站