wakitsu
Version:
Hobby project for managing anime watch list on Kitsu through CLI
46 lines • 1.49 kB
JavaScript
import { CLIFlag } from '../cli.js';
import { Config } from '../../config.js';
import { Printer } from '../../printer/printer.js';
export class ColorFlag extends CLIFlag {
name = ['cl', 'color'];
type = 'simple';
helpAliases = [
...this.name,
'display profile',
'show profile',
'get profile',
'lookup profile',
];
shortHelpDisplay = 'Toggle the console colors ;bg;On ;x;or ;r;Off;bk;.';
getHelpLogs() {
return [
['h1', ['Toggle Console Color']],
['p', 'Turns ;g;On ;bk;or ;r;Off ;bk;the console colors.'],
null,
[
'p',
'If the color is currently ;g;On;bk;, then executing the command will turn ' +
';r;Off ;bk;the color. Likewise, if the color is currently ;r;Off;bk;, ' +
'executing the command will turn ;g;On ;bk;the color.',
],
null,
];
}
getSyntaxHelpLogs() {
return [
['h2', ['Usage']],
['s', ['c', 'color'], ''],
null,
['h2', ['Examples']],
['e', ['c', '']],
['e', ['color', '']],
];
}
exec() {
const colorState = Config.get('useColor');
Config.set('useColor', !colorState);
Printer.print([null, ['py', ['Color', `${!colorState ? ';bg;On' : 'Off'}`]], null]);
Config.save();
}
}
//# sourceMappingURL=flag-color.js.map