mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-20 20:23:57 +00:00
38 lines
618 B
TypeScript
38 lines
618 B
TypeScript
export interface Settings {
|
|
verbose: boolean;
|
|
concise: boolean;
|
|
silent: boolean;
|
|
bufferStdout: boolean;
|
|
}
|
|
|
|
export function createDefaultSettings(): Settings {
|
|
return {
|
|
verbose: false,
|
|
concise: false,
|
|
silent: false,
|
|
bufferStdout: true,
|
|
};
|
|
}
|
|
|
|
export function translateSettings(settings: Settings): string[] {
|
|
const switches: string[] = [];
|
|
|
|
if (settings.verbose) {
|
|
switches.push("-v");
|
|
}
|
|
|
|
if (settings.concise) {
|
|
switches.push("-c");
|
|
}
|
|
|
|
if (settings.silent) {
|
|
switches.push("-s");
|
|
}
|
|
|
|
if (settings.bufferStdout) {
|
|
switches.push("-b");
|
|
}
|
|
|
|
return switches;
|
|
}
|