Tauri getMatches

2024-01-31 16:49 更新
getMatches(): Promise<CliMatches>

解析提供給當(dāng)前進程的參數(shù),并使用 中定義的配置 tauri.cli 獲取匹配項tauri.conf.json


import { getMatches } from '@tauri-apps/api/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
}

Since: 1.0.0

Returns: ?Promise?<?CliMatches?>


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號