@vexify-org/yaggs 6.8.0 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -0
- package/lib/parser.js +26 -0
- package/package.json +1 -1
package/index.js
CHANGED
package/lib/parser.js
CHANGED
|
@@ -924,6 +924,32 @@ complete -c ${this.scriptName} `;
|
|
|
924
924
|
});
|
|
925
925
|
}
|
|
926
926
|
|
|
927
|
+
spinner(message = 'Loading') {
|
|
928
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
929
|
+
let frameIndex = 0;
|
|
930
|
+
let interval;
|
|
931
|
+
|
|
932
|
+
const start = () => {
|
|
933
|
+
interval = setInterval(() => {
|
|
934
|
+
process.stdout.write(`\r\u001b[34m${frames[frameIndex]} ${message}\u001b[0m`);
|
|
935
|
+
frameIndex = (frameIndex + 1) % frames.length;
|
|
936
|
+
}, 80);
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
const stop = (finalMessage = '') => {
|
|
940
|
+
clearInterval(interval);
|
|
941
|
+
if (finalMessage) {
|
|
942
|
+
process.stdout.write(`\r\u001b[32m✓ ${finalMessage}\u001b[0m\n`);
|
|
943
|
+
} else {
|
|
944
|
+
process.stdout.write('\r');
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
start();
|
|
949
|
+
|
|
950
|
+
return { stop };
|
|
951
|
+
}
|
|
952
|
+
|
|
927
953
|
getHelp() {
|
|
928
954
|
let help = `\u001b[36m${this.scriptName}\u001b[0m`;
|
|
929
955
|
|