barcat.git
17 months agoversion 1.09 before adding even more complex features v1.09
Mischa POSLAWSKY [Mon, 21 Nov 2022 21:35:31 +0000 (22:35 +0100)]
version 1.09 before adding even more complex features

17 months agodatabase examples compatible with sqlite
Mischa POSLAWSKY [Fri, 18 Nov 2022 20:34:12 +0000 (21:34 +0100)]
database examples compatible with sqlite

Real life use cases.

Commandline SQL changed to apply to SQLite as well.  Unfortunately maths
requires v3.35, so keep psql there even though it requires user setup.

17 months agodistinguish column -n argument in examples
Mischa POSLAWSKY [Fri, 18 Nov 2022 19:17:31 +0000 (20:17 +0100)]
distinguish column -n argument in examples

Required in common 4.3BSD version, but entirely incompatible with the
linux-util replacement on at least modern Debian.

17 months agoexplain -w default (COLUMNS environment)
Mischa POSLAWSKY [Fri, 18 Nov 2022 19:12:02 +0000 (20:12 +0100)]
explain -w default (COLUMNS environment)

17 months agot: untested formatting/marker features
Mischa POSLAWSKY [Fri, 18 Nov 2022 19:01:37 +0000 (20:01 +0100)]
t: untested formatting/marker features

17 months agot/examples: optional sample/media as exiftool input
Mischa POSLAWSKY [Sat, 19 Nov 2022 18:49:59 +0000 (19:49 +0100)]
t/examples: optional sample/media as exiftool input

17 months agot/examples: skip downloads unless enabled
Mischa POSLAWSKY [Thu, 17 Nov 2022 21:34:24 +0000 (22:34 +0100)]
t/examples: skip downloads unless enabled

Alleviate external resources further unless sample/data exists.

17 months agot/examples: skip missing command dependencies
Mischa POSLAWSKY [Thu, 17 Nov 2022 20:41:49 +0000 (21:41 +0100)]
t/examples: skip missing command dependencies

Assume requirement at line start, and not a mistake if not found locally.

17 months agot/examples: record resulting output for review
Mischa POSLAWSKY [Thu, 17 Nov 2022 18:16:03 +0000 (19:16 +0100)]
t/examples: record resulting output for review

17 months agot/examples: test and save curl downloads
Mischa POSLAWSKY [Thu, 17 Nov 2022 03:30:25 +0000 (04:30 +0100)]
t/examples: test and save curl downloads

17 months agomake install rule to copy to /usr/local/bin
Mischa POSLAWSKY [Wed, 16 Nov 2022 20:17:12 +0000 (21:17 +0100)]
make install rule to copy to /usr/local/bin

17 months agocombined value and sum formatting, --reformat
Mischa POSLAWSKY [Sun, 20 Nov 2022 17:17:14 +0000 (18:17 +0100)]
combined value and sum formatting, --reformat

Apply value-format to all stat values; exception to keep unformatted input
indicated by an experimental reformat option.

17 months agolength padding on formatted values
Mischa POSLAWSKY [Thu, 17 Nov 2022 18:23:12 +0000 (19:23 +0100)]
length padding on formatted values

17 months agoreserve minimal length for -H formatting
Mischa POSLAWSKY [Tue, 15 Nov 2022 17:23:46 +0000 (18:23 +0100)]
reserve minimal length for -H formatting

Without a more expensive calculation, assume regular results of 3 digits and
a unit, without sign and exponent for which the reserved amount would still
be insufficient.

17 months agosupport negative sexagesimal times
Mischa POSLAWSKY [Tue, 15 Nov 2022 12:41:48 +0000 (13:41 +0100)]
support negative sexagesimal times

Work around perl's weird modulo op.

17 months agosexagesimal time formatting option
Mischa POSLAWSKY [Mon, 14 Nov 2022 23:33:56 +0000 (00:33 +0100)]
sexagesimal time formatting option

Convert duration values from previous examples; like ffprobe -sexagesimal.

17 months agocompare media example (exiftool, ffprobe)
Mischa POSLAWSKY [Mon, 14 Nov 2022 23:31:16 +0000 (00:31 +0100)]
compare media example (exiftool, ffprobe)

Personal use case featuring two popular tools with different strengths and
interfaces.

Omit a third alternative with similar results due to being objectively much
worse in my experience:

mediainfo --inform='General;%Duration% %OverallBitRate% %FileNameExtension%\n' *

17 months agoshorthand -f+ for first number (+0)
Mischa POSLAWSKY [Sun, 20 Nov 2022 17:50:45 +0000 (18:50 +0100)]
shorthand -f+ for first number (+0)

17 months agoprefix + to select numeric fields in -f
Mischa POSLAWSKY [Mon, 14 Nov 2022 23:19:41 +0000 (00:19 +0100)]
prefix + to select numeric fields in -f

Possible using regular expressions, but needlessly complex for such a common
use or desire.

17 months agoswap -C to enable color, -M to disable
Mischa POSLAWSKY [Mon, 14 Nov 2022 15:50:44 +0000 (16:50 +0100)]
swap -C to enable color, -M to disable

Inconsistent in other programs, but lets copy somewhat related `jq` instead.
Afaict mostly `watch` has -c, and that's for input interpretation.
Frees lowercase c for Count or Column.

17 months agoNO_COLOR environment as default --color
Mischa POSLAWSKY [Mon, 14 Nov 2022 15:42:11 +0000 (16:42 +0100)]
NO_COLOR environment as default --color

Popular standard explained on: https://no-color.org/

17 months agorestrict spark index to maximum value
Mischa POSLAWSKY [Sun, 13 Nov 2022 14:28:46 +0000 (15:28 +0100)]
restrict spark index to maximum value

17 months agotreat zero as non-empty spark value
Mischa POSLAWSKY [Sun, 13 Nov 2022 14:17:09 +0000 (15:17 +0100)]
treat zero as non-empty spark value

17 months agoprotest against unknown palette presets
Mischa POSLAWSKY [Sun, 13 Nov 2022 02:28:32 +0000 (03:28 +0100)]
protest against unknown palette presets

17 months agorotate sparkless indicators default
Mischa POSLAWSKY [Sat, 12 Nov 2022 23:52:17 +0000 (00:52 +0100)]
rotate sparkless indicators default

17 months agorandom palette of 215 colours
Mischa POSLAWSKY [Sun, 13 Nov 2022 00:44:16 +0000 (01:44 +0100)]
random palette of 215 colours

Distinguish a limited number of values without regard for order.

17 months agorainbow (lolcat) colour palette
Mischa POSLAWSKY [Sat, 12 Nov 2022 23:43:16 +0000 (00:43 +0100)]
rainbow (lolcat) colour palette

17 months agoretire 88-colour palettes
Mischa POSLAWSKY [Sat, 12 Nov 2022 23:38:35 +0000 (00:38 +0100)]
retire 88-colour palettes

Assume 256color terminals nowadays; even Debian's oldstable rxvt-unicode has
switched defaults.

17 months agosimplify or clean up example scriptlets
Mischa POSLAWSKY [Sat, 12 Nov 2022 23:37:24 +0000 (00:37 +0100)]
simplify or clean up example scriptlets

17 months agocrop limits beyond available lines
Mischa POSLAWSKY [Sat, 12 Nov 2022 23:06:49 +0000 (00:06 +0100)]
crop limits beyond available lines

Silence warnings about unitialized values.

17 months agoprefix indicators option without spark
Mischa POSLAWSKY [Sun, 6 Nov 2022 14:05:23 +0000 (15:05 +0100)]
prefix indicators option without spark

17 months agofull distribution over sparkline indicators
Mischa POSLAWSKY [Sun, 6 Nov 2022 14:04:05 +0000 (15:04 +0100)]
full distribution over sparkline indicators

No unexpected min/max exceptions.

17 months agoprepare to fix spark distribution
Mischa POSLAWSKY [Wed, 2 Nov 2022 19:47:44 +0000 (20:47 +0100)]
prepare to fix spark distribution

Test case which is seriously broken rn.

17 months agoversion 1.08 with extra cat v1.08
Mischa POSLAWSKY [Tue, 1 Nov 2022 18:43:50 +0000 (19:43 +0100)]
version 1.08 with extra cat

17 months agodraw mascot cat in usage message
Mischa POSLAWSKY [Tue, 1 Nov 2022 18:41:46 +0000 (19:41 +0100)]
draw mascot cat in usage message

17 months agomove sparkline example below interrupted git group
Mischa POSLAWSKY [Mon, 31 Oct 2022 19:57:55 +0000 (20:57 +0100)]
move sparkline example below interrupted git group

17 months agoempty program arguments do not need to be parsed
Mischa POSLAWSKY [Mon, 31 Oct 2022 19:53:24 +0000 (20:53 +0100)]
empty program arguments do not need to be parsed

Using Getopt::Long takes ~the same time as running the rest of the script,
about 250ms on a rpi1, so runtime can be halved if there's no options.

17 months agot: planned test count beforehand
Mischa POSLAWSKY [Mon, 31 Oct 2022 19:49:22 +0000 (20:49 +0100)]
t: planned test count beforehand

Small effort to indicate units size, allowing rough eta estimation.

17 months agounit rounding corner case
Mischa POSLAWSKY [Mon, 31 Oct 2022 16:08:57 +0000 (17:08 +0100)]
unit rounding corner case

Earlier commits did not account for odd unit offsets with one less digit
like 9950 rounding to 10.0k (or 9.9k with the previous fix) instead of 10k.

17 months agounit formatting of negatives
Mischa POSLAWSKY [Mon, 31 Oct 2022 19:38:28 +0000 (20:38 +0100)]
unit formatting of negatives

17 months agokeep valueless lines as is
Mischa POSLAWSKY [Mon, 31 Oct 2022 19:23:05 +0000 (20:23 +0100)]
keep valueless lines as is

No padding or graph (from negative minimums).

17 months agoshift unit to prevent additional digits after rounding
Mischa POSLAWSKY [Mon, 31 Oct 2022 15:40:35 +0000 (16:40 +0100)]
shift unit to prevent additional digits after rounding

Fix 0.9995 from showing up as 1000m instead of 1.0.

17 months agostatic usage text, generation code into reformat-podusage script
Mischa POSLAWSKY [Mon, 31 Oct 2022 14:33:19 +0000 (15:33 +0100)]
static usage text, generation code into reformat-podusage script

Significantly faster and less convoluted, at the small cost of tracking some
documentation twice.

17 months agot: ensure failure if field gets fed an invalid regexp value
Mischa POSLAWSKY [Tue, 4 Feb 2020 14:06:39 +0000 (15:06 +0100)]
t: ensure failure if field gets fed an invalid regexp value

17 months agonegative limit range counting from end
Mischa POSLAWSKY [Sun, 28 Mar 2021 02:51:55 +0000 (04:51 +0200)]
negative limit range counting from end

17 months agonegative limit counts from last line
Mischa POSLAWSKY [Sat, 27 Mar 2021 22:57:35 +0000 (23:57 +0100)]
negative limit counts from last line

2 years agot: planned feature for negative limits
Mischa POSLAWSKY [Sat, 27 Mar 2021 21:59:58 +0000 (22:59 +0100)]
t: planned feature for negative limits

Do not count names ending in #TODO as failing.

2 years agoapply value formatting to statistics
Mischa POSLAWSKY [Sat, 27 Mar 2021 21:58:25 +0000 (22:58 +0100)]
apply value formatting to statistics

2 years agoascii option to avoid unicode
Mischa POSLAWSKY [Fri, 19 Mar 2021 02:59:09 +0000 (03:59 +0100)]
ascii option to avoid unicode

2 years agocapture error messages from examples
Mischa POSLAWSKY [Fri, 19 Mar 2021 02:40:22 +0000 (03:40 +0100)]
capture error messages from examples

2 years agoIPC::Run to run example commands
Mischa POSLAWSKY [Fri, 19 Mar 2021 02:36:43 +0000 (03:36 +0100)]
IPC::Run to run example commands

2 years agodeclare value formatting functions in options
Mischa POSLAWSKY [Thu, 18 Mar 2021 18:41:37 +0000 (19:41 +0100)]
declare value formatting functions in options

2 years agoround partial sum to avoid floating point errors
Mischa POSLAWSKY [Sat, 13 Mar 2021 06:16:29 +0000 (07:16 +0100)]
round partial sum to avoid floating point errors

Optional value available since commit v1.03-19-g0938debbad (2019-09-08)
[indicate limited results in stats] was overlooked while fixing formatting
in v1.06-24-g28f38df922 (2019-10-08) [round total value in statistics].

2 years agocomment long regexp in usage preparation
Mischa POSLAWSKY [Sat, 13 Mar 2021 06:08:09 +0000 (07:08 +0100)]
comment long regexp in usage preparation

Insert whitespace and comments for readability.

2 years agostrip pipe arguments from test options
Mischa POSLAWSKY [Sat, 13 Mar 2021 06:03:13 +0000 (07:03 +0100)]
strip pipe arguments from test options

Allow combination of -value and |command (or ?status) suffixes,
without the latter part being duplicated.

2 years agofollow download redirects in example scripts
Mischa POSLAWSKY [Sat, 13 Mar 2021 05:51:27 +0000 (06:51 +0100)]
follow download redirects in example scripts

Found by examples.t tester because curl commands were literally incomplete.

2 years agocustom diagnostics in example test failure
Mischa POSLAWSKY [Sat, 13 Mar 2021 05:42:54 +0000 (06:42 +0100)]
custom diagnostics in example test failure

Replace constant "Failed test at line" by a more interesting report of
source location and result discrepancy.

2 years agosimplify test names of example code
Mischa POSLAWSKY [Sat, 13 Mar 2021 04:15:36 +0000 (05:15 +0100)]
simplify test names of example code

Keep only the first command or more significant parameter to minimally
identify the concerning script.

Add diagnostics output of the full command on failure.

2 years agotest return status of example commands and pipes
Mischa POSLAWSKY [Sat, 13 Mar 2021 04:05:34 +0000 (05:05 +0100)]
test return status of example commands and pipes

Explicitly run with bash so intermediate failure can be detected using the
pipefail option.

2 years agoadjust example commands for testing
Mischa POSLAWSKY [Sat, 13 Mar 2021 03:59:43 +0000 (04:59 +0100)]
adjust example commands for testing

2 years agoscript to run examples from documentation
Mischa POSLAWSKY [Sat, 13 Mar 2021 03:54:50 +0000 (04:54 +0100)]
script to run examples from documentation

2 years agotest and warn about invalid marker values
Mischa POSLAWSKY [Fri, 12 Mar 2021 01:23:07 +0000 (02:23 +0100)]
test and warn about invalid marker values

2 years agoeval test options to allow quoted values
Mischa POSLAWSKY [Sat, 13 Mar 2021 05:58:13 +0000 (06:58 +0100)]
eval test options to allow quoted values

Shell scripting fix for whitespace in set parameters.

2 years agosilence warnings on spark
Mischa POSLAWSKY [Fri, 12 Mar 2021 01:06:53 +0000 (02:06 +0100)]
silence warnings on spark

2 years agotest spark option
Mischa POSLAWSKY [Fri, 12 Mar 2021 01:05:20 +0000 (02:05 +0100)]
test spark option

2 years agoannotate intentional lvalue substr
Mischa POSLAWSKY [Mon, 21 Feb 2022 13:25:00 +0000 (14:25 +0100)]
annotate intentional lvalue substr

Advised against by perlcritic and PBP because of confusion and efficiency.
The latter seems contrary to actual benchmark results in v5.24-5.28,
where this form is at least 5% faster (even with a dummy length argument).

2 years agoend subroutines with return
Mischa POSLAWSKY [Sat, 22 Feb 2020 00:47:57 +0000 (01:47 +0100)]
end subroutines with return

Stern perlcritic complaint, referencing page 197 of PBP.

2 years agocode cleanup following some perlcritic warnings
Mischa POSLAWSKY [Mon, 21 Feb 2022 12:24:27 +0000 (13:24 +0100)]
code cleanup following some perlcritic warnings

Rules about mixed precedence, uninitialized local, and capture variable use
all improve clarity without disadvantages.

2 years agoenable /x in all regular expressions
Mischa POSLAWSKY [Sat, 22 Feb 2020 00:51:56 +0000 (01:51 +0100)]
enable /x in all regular expressions

Enforce extended legibility as recommended by PBP page 236.

2 years agoenable /ms in all regular expressions
Mischa POSLAWSKY [Sun, 16 Feb 2020 21:05:51 +0000 (22:05 +0100)]
enable /ms in all regular expressions

Recommended options (PBP pages 237-241) for consistent behaviour.

4 years agostable enough version 1.07 v1.07
Mischa POSLAWSKY [Sat, 25 Jan 2020 03:01:57 +0000 (04:01 +0100)]
stable enough version 1.07

4 years agopostgresql client invocation example
Mischa POSLAWSKY [Sun, 16 Feb 2020 21:08:16 +0000 (22:08 +0100)]
postgresql client invocation example

Personal favourite to quickly visualise statistics.

4 years agorename remaining graph references in documentation
Mischa POSLAWSKY [Fri, 7 Feb 2020 19:25:20 +0000 (20:25 +0100)]
rename remaining graph references in documentation

Commands still using the old name after the change in commit:
v1.03-0-g9cb7fa212a (2019-09-07) [hello barcat =^.^=]

4 years agodocument remaining color options
Mischa POSLAWSKY [Wed, 29 Jan 2020 17:44:43 +0000 (18:44 +0100)]
document remaining color options

4 years agocleanup superfluous hide checks in show_lines()
Mischa POSLAWSKY [Wed, 29 Jan 2020 17:29:01 +0000 (18:29 +0100)]
cleanup superfluous hide checks in show_lines()

Existing code duplicated in commit v1.03-16-g62a8af4725 (2019-09-08)
[stat (-s) option to summarise totals at end].

4 years agoprepare decremented hidemin value
Mischa POSLAWSKY [Wed, 29 Jan 2020 17:26:29 +0000 (18:26 +0100)]
prepare decremented hidemin value

Avoid repeated calculation for cleaner code.

4 years agomove subroutine sival() out of readline loop
Mischa POSLAWSKY [Wed, 29 Jan 2020 17:23:40 +0000 (18:23 +0100)]
move subroutine sival() out of readline loop

Satisfy perlcritic complaint about being nested.

4 years agorefer to bold as bright in black colour documentation
Mischa POSLAWSKY [Sat, 25 Jan 2020 02:17:44 +0000 (03:17 +0100)]
refer to bold as bright in black colour documentation

4 years agoconsistent documentation syntax of options
Mischa POSLAWSKY [Sat, 25 Jan 2020 00:01:17 +0000 (01:01 +0100)]
consistent documentation syntax of options

4 years agoalign long options in usage
Mischa POSLAWSKY [Fri, 24 Jan 2020 23:57:04 +0000 (00:57 +0100)]
align long options in usage

4 years agoabbreviate usage output
Mischa POSLAWSKY [Fri, 24 Jan 2020 23:49:52 +0000 (00:49 +0100)]
abbreviate usage output

Modify pod document before formatting short usage lists to fit most options
on single lines, similar to and expected for most command line interfaces.

4 years agot: ignore t1801 warning missing Tie::Array::Sorted
Mischa POSLAWSKY [Fri, 24 Jan 2020 22:27:25 +0000 (23:27 +0100)]
t: ignore t1801 warning missing Tie::Array::Sorted

Non-fatal message should not fail tests.

4 years agot: execute multiple arguments in shell wrapper
Mischa POSLAWSKY [Fri, 24 Jan 2020 22:25:29 +0000 (23:25 +0100)]
t: execute multiple arguments in shell wrapper

Support combined *.in filename with other parameters, so shell execution can
be applied on t1801-progress.

4 years agoclean up common value range calculation
Mischa POSLAWSKY [Fri, 24 Jan 2020 22:00:21 +0000 (23:00 +0100)]
clean up common value range calculation

4 years agosilence warning calculating size of zero values
Mischa POSLAWSKY [Fri, 24 Jan 2020 21:59:27 +0000 (22:59 +0100)]
silence warning calculating size of zero values

4 years agotest value parameters and option parsing
Mischa POSLAWSKY [Fri, 24 Jan 2020 21:54:10 +0000 (22:54 +0100)]
test value parameters and option parsing

4 years agowrap long code lines to 80 characters
Mischa POSLAWSKY [Fri, 24 Jan 2020 21:50:49 +0000 (22:50 +0100)]
wrap long code lines to 80 characters

Some illegible oneliners crept in.

4 years agoignore interval option without input file
Mischa POSLAWSKY [Fri, 24 Jan 2020 20:59:05 +0000 (21:59 +0100)]
ignore interval option without input file

4 years agosimplify users example code (s/sed/tr/)
Mischa POSLAWSKY [Tue, 21 Jan 2020 16:02:33 +0000 (17:02 +0100)]
simplify users example code (s/sed/tr/)

4 years agolexical sub feature no longer required
Mischa POSLAWSKY [Tue, 21 Jan 2020 16:02:23 +0000 (17:02 +0100)]
lexical sub feature no longer required

Replaced by a variable in commit v1.06-4-gca702a0a92 (2019-09-24)
[customizable format for markers option].  Reverts v1.01-11-g754ddc0faf
(2019-09-05) [enable lexical subs before perl v5.26].

4 years agoclean up doubly titled xml example
Mischa POSLAWSKY [Tue, 21 Jan 2020 16:02:17 +0000 (17:02 +0100)]
clean up doubly titled xml example

Line left after replacement in commit v1.04-1-ge8e86ee4ef (2019-09-10)
[reorder examples by complexity].

4 years agooptional width of sparkline lines
Mischa POSLAWSKY [Mon, 14 Oct 2019 23:06:59 +0000 (01:06 +0200)]
optional width of sparkline lines

Output newlines after specified number of records.
Keep current single line by default.

4 years agoround total value slightly in statistics
Mischa POSLAWSKY [Sun, 6 Oct 2019 23:51:05 +0000 (01:51 +0200)]
round total value slightly in statistics

Compensate for cumulative floating point errors showing up.

4 years agonumber of lines distinct from values in statistics
Mischa POSLAWSKY [Sun, 6 Oct 2019 23:48:38 +0000 (01:48 +0200)]
number of lines distinct from values in statistics

Indicate ignored (non-numeric) rows if any.  Unchanged otherwise.

4 years agot: filename shorthand '_?' to compare exit code
Mischa POSLAWSKY [Fri, 4 Oct 2019 03:15:51 +0000 (05:15 +0200)]
t: filename shorthand '_?' to compare exit code

Make it easier to check for non-zero $? by replacing ' |[ $? = N ]' by ' ?N'
for same results with minimal clutter.

4 years agonumeric inline parameters override value input
Mischa POSLAWSKY [Thu, 3 Oct 2019 21:51:57 +0000 (23:51 +0200)]
numeric inline parameters override value input

Commandline shorthand for simple manual entry with unambiguous numbers.

4 years agot: strip options from input file names
Mischa POSLAWSKY [Thu, 3 Oct 2019 21:01:58 +0000 (23:01 +0200)]
t: strip options from input file names

Ignore everything after underscore in output files, so input files do not
need to match irrelevant test options (source data can remain unchanged
regardless of further test variations).

4 years agot: optional input by omitting *.in files
Mischa POSLAWSKY [Thu, 3 Oct 2019 20:49:11 +0000 (22:49 +0200)]
t: optional input by omitting *.in files

Verify t0* work correctly without dummy input.

4 years agolimit without arguments for all (statistics only)
Mischa POSLAWSKY [Thu, 3 Oct 2019 20:47:23 +0000 (22:47 +0200)]
limit without arguments for all (statistics only)

4 years agovalue color in spark mode
Mischa POSLAWSKY [Mon, 23 Sep 2019 23:39:23 +0000 (01:39 +0200)]
value color in spark mode