From 2c19ba0d02094d7e0607cc190610f2643a25e37a Mon Sep 17 00:00:00 2001 From: Gabriel Florit Date: Fri, 30 Aug 2013 17:25:00 -0400 Subject: [PATCH 1/3] added ability to mention item type --- pace.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pace.js b/pace.js index f66a50f..22f7a45 100644 --- a/pace.js +++ b/pace.js @@ -43,6 +43,9 @@ function Pace(options) { // Whether to show current burden %. this.show_burden = options.showBurden || false; + + // Type of item, e.g. 'widgets' + this.itemType = options.itemType || ''; // Internal time tracking properties. this.started = false; @@ -173,7 +176,7 @@ Pace.prototype.outputStats = function outputStats() { this.charm.write(' ').display('bright').write(this.perc + '%').display('reset'); this.total_len = formatNumber(this.total).length; this.charm.write(' ').display('bright').write(padLeft(formatNumber(this.current), this.total_len)).display('reset'); - this.charm.write('/' + formatNumber(this.total)); + this.charm.write('/' + formatNumber(this.total) + ' ' + this.itemType); // Output burden. if (this.show_burden) { From b687e746368f370e38493a14b0c3979a0e64a0ac Mon Sep 17 00:00:00 2001 From: Gabriel Florit Date: Fri, 30 Aug 2013 17:31:34 -0400 Subject: [PATCH 2/3] formatting --- pace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pace.js b/pace.js index 22f7a45..0b294df 100644 --- a/pace.js +++ b/pace.js @@ -44,7 +44,7 @@ function Pace(options) { // Whether to show current burden %. this.show_burden = options.showBurden || false; - // Type of item, e.g. 'widgets' + // Type of item, e.g. 'widgets'. this.itemType = options.itemType || ''; // Internal time tracking properties. From e3824cd44c7c2237a597f0e3a29c02d5c54e9958 Mon Sep 17 00:00:00 2001 From: Gabriel Florit Date: Fri, 30 Aug 2013 17:41:10 -0400 Subject: [PATCH 3/3] added itemType mention to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 11de9de..7d8b8b8 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Supported Options: * `total` - The total number of operations that _YOUR_ script will execute. * `maxBurden` - The maximum 'burden' that the progress bar should incur. See more about burden below. * `showBurden` - Mostly for debugging. Show the current burden / skipped steps with the other metrics. + * `itemType` - The type of item being processed, e.g. 'widgets'. ### pace.op([count]) ### Signal to pace that an operation was completed in your script by calling