feat(cli): add machine-readable CLI help, recommendation, and configuration flows
This commit is contained in:
@@ -1,14 +1,31 @@
|
||||
import * as plugins from './mod.plugins.js';
|
||||
import { FormatStats } from './classes.formatstats.js';
|
||||
import * as plugins from "./mod.plugins.js";
|
||||
import { FormatStats } from "./classes.formatstats.js";
|
||||
|
||||
interface IFormatContextOptions {
|
||||
interactive?: boolean;
|
||||
jsonOutput?: boolean;
|
||||
}
|
||||
|
||||
export class FormatContext {
|
||||
private formatStats: FormatStats;
|
||||
private interactive: boolean;
|
||||
private jsonOutput: boolean;
|
||||
|
||||
constructor() {
|
||||
constructor(options: IFormatContextOptions = {}) {
|
||||
this.formatStats = new FormatStats();
|
||||
this.interactive = options.interactive ?? true;
|
||||
this.jsonOutput = options.jsonOutput ?? false;
|
||||
}
|
||||
|
||||
getFormatStats(): FormatStats {
|
||||
return this.formatStats;
|
||||
}
|
||||
|
||||
isInteractive(): boolean {
|
||||
return this.interactive;
|
||||
}
|
||||
|
||||
isJsonOutput(): boolean {
|
||||
return this.jsonOutput;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user