commands: add gn general options
This commit is contained in:
@@ -3,6 +3,7 @@ export function undefList<T, U>(opt: T | undefined, fn: (opt: T) => U) {
|
||||
}
|
||||
|
||||
export const optFlag = (flag: string, opt: string | undefined) => undefList(opt, opt => [flag, opt])
|
||||
export const optFlagEq = (flag: string, opt: string | undefined) => undefList(opt, opt => [`${flag}=${opt}`])
|
||||
|
||||
/**
|
||||
* Generate a switch flag, like "--rebuild", "--nobuild"
|
||||
|
||||
14
src/commands/gn.ts
Normal file
14
src/commands/gn.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { optFlagEq } from "./common.js";
|
||||
|
||||
export interface GeneralOptions {
|
||||
/**
|
||||
* Specifies build arguments overrides.
|
||||
*/
|
||||
args?: string[]
|
||||
}
|
||||
|
||||
export function generalOptions(o: GeneralOptions) {
|
||||
return [
|
||||
...optFlagEq("--args", o.args?.join(' ')),
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user