Commit Graph

273 Commits (8bedbe47a7808fa302a406e6a7a226abb6eb4808)

Author SHA1 Message Date
John D Pell 866e5be86b lib/command_duration: tests & whitespace 2022-03-04 12:58:07 -08:00
John D Pell 4e0e59230b lib/command_duration: rename `theme/command_duration.theme`
Rename the `theme/command_duration.theme` file as it's not really got anything to do with theming or SCM.
2022-03-04 12:58:07 -08:00
John D Pell 6ca10cf84c plugin/cmd-returned-notify: Rewrite to match/use `lib/command_duration`
Use `$EPOCHREALTIME` (or `$SECONDS`) built-in variable provided by Bash instead of `date +%s`. We're only measuing the difference in seconds, so avoid both the binary invocation as well as the subshell.

Alsö, Reduce environmental pollution by not exporting every variable, and unsetting when done.

Change variable names to match lib/command-duration

Remove `preexec_return_notification()` in favor of `lib/command-duration`'s `_command_duration_pre_exec()`.

This should now use the same preexec hook and variables as the theme library `command_duration`.

tests: handle nanoseconds
2022-03-04 12:58:07 -08:00
John D Pell 6d422f17e4 Revert dc380e9ed6 2022-03-03 23:33:05 -08:00
John D Pell dc380e9ed6 test/battery: fix tests… 2022-03-03 23:14:33 -08:00
John D Pell 6734baf950 test/base: lose old TravisCS skip 2022-03-03 23:02:29 -08:00
John D Pell a9dda3d358 test/preexec: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 0d55a2406c test/base: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell f0dfe1a67f test/theme: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell b686515877 test/xterm: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell a36a4c4038 test/ruby: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell fbf7efa1b8 test/go: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 4a9df8ec88 test/cmd-returned-notify: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 6e2e0af7f9 test/battery: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell beac9c430a test/aliases: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell fd91211704 test/utilities: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 629a1b0c0d test/search: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell e5cd10112c test/log: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 1ddec65d56 test/helpers: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 425ef3e10a test/composure: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell 2a95e983d0 test/install: adopt newly revamped `setup()`
test/uninstall: adopt newly revamped `setup()`

test/install: `local_setup_file()`
2022-03-03 22:43:17 -08:00
John D Pell c837232643 test/bash-it: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell de31a308f9 test/bash_it: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell fd1771d45c test/base: adopt newly revamped `setup()` 2022-03-03 22:43:17 -08:00
John D Pell cb9b999f06 BATS: de-parallelize
Run the test *files* in parallel, but not the tests *within* the files. This can be reverted after configuration (i.e., `$BASH_IT/enabled` et al) lives *outside* the repo.
2022-03-03 22:43:17 -08:00
John D Pell 014c102b71 BATS: revamp test `setup()` and `setup_test_fixture()` 2022-03-03 22:43:17 -08:00
John D Pell 789ede9ef3 plugin/battery: fix tests 2022-02-24 12:52:26 -08:00
Noah Gorny 0619c19f65
Merge pull request #2074 from NariyasuHeseri/master
plugin/battery: bug fix
2022-02-14 08:22:33 +02:00
Noah Gorny 561e282585
Merge pull request #2044 from gaelicWizard/completion/alias
completion/aliases: eliminate use of `eval`
2022-02-13 23:59:35 +02:00
John D Pell a9a40a3cad lib/helpers: add `preview` to `bash-it` spaghetti 2022-02-07 15:27:03 -08:00
John D Pell 302bae9c5f test/battery: require matching battery identifier 2022-02-03 16:47:17 -08:00
John D Pell 23f7916a4d test/battery: add multiple-battery edge case 2022-02-03 10:45:27 -08:00
John D Pell b0862899d7 completion/alias: fix tests 2022-01-30 16:13:54 -08:00
John D Pell 7fcad6ed0d completion/alias: rename
There is no reason for this to be in the `plugins` directory, it just needs to have a load priority sufficiently high that it runs after any aliases are defined.
2022-01-30 16:13:54 -08:00
Noah Gorny 2a9ee7e344
Merge pull request #2019 from gaelicWizard/lib/colors
lib/colors: split out metaprogramming
2022-01-30 00:10:14 +02:00
John D Pell 4cf2aae36e lib/search: code cleanup
Improve `_bash-it-erase-term()`, `_bash-it-flash-term()`, `_bash-it-rewind()`, `_bash-it-search-result()`, and `_bash-it-search-component()`. Minor tweaks to `_bash-it-is-partial-match()`, and `_bash-it-search()`.
2022-01-28 13:35:17 -08:00
John D Pell afeb4d6e11 lib/search: `shellcheck`
SC2076
SC2091
SC2004
SC2086
SC2207
2022-01-28 13:35:17 -08:00
John D Pell 16cee1956d lib/colors: revert #99
This reverts bash-it/bash-it#99, a metaprogramming adventure in terminal color code escape computation. It was functionally reverted in bash-it/bash-it#699; I'm just finishing the job.
2022-01-28 13:08:50 -08:00
John D Pell 2a8d8ba540 lib/colors: rename `theme/colors` 2022-01-28 13:08:50 -08:00
John D Pell 2343e2dd35 lib/preexec: tests! 2022-01-27 12:40:38 -08:00
John D Pell 7a0b353cea lib/preexec: rename `vendor/init.d/preexec.bash` 2022-01-25 13:00:04 -08:00
John D Pell 5f9a3f143f completion/bash-it: rename `_bash-it-comp()`
...to `_bash-it()`.

The norm is for the completion function for, e.g., `teh_cmd`. to be named with the same name and a prepended underscore, i.e. `_teh_cmd`. This alsö reduces namespace confusion, which will be relevant in a future patch.
2022-01-24 21:41:23 -08:00
John D Pell e1e971c0ea completion/bash-it: use `read -a` to populate `$COMPREPLY`
This allows for spaces and special characters in file names, i.e. internaltional/unicode words.
2022-01-24 21:41:13 -08:00
John D Pell 3874ad85c2 completion/bash-it: use existing functions 2022-01-24 21:41:13 -08:00
Noah Gorny edc36795b5
Merge pull request #2030 from gaelicWizard/bats
Update BATS
2022-01-24 23:29:00 +02:00
John D Pell 805eab804c lib/helpers: fix profile subcommand tests 2022-01-18 11:02:37 -08:00
John D Pell 550f808884 lib/helpers: fix `_bash-it-describe()`
Use `_bash-it-component-item-is-enabled()`

Fix SC2295
2022-01-18 11:02:37 -08:00
John D Pell 5eab3bd288 lib/helpers: first `shellcheck` pass
Quote things, SC2268, SC2143, SC2181, SC2162, SC2016, SC2013, &c.

Rewrite globbing per `shellcheck`’s SC2013, and alsö s/typeset/local/g. Eliminate `compgen` where possible.

Alsö: use the existing utility functions `_bash-it-get-component-type-from-path` and `_bash-it-get-component-name-from-path`, which just use parameter substitution anyway. Why was `sed` here?

Alsö, don't add not-existing directories to `$PATH` in `pathmunge()`.

Finally, merge PR #1865 from NoahGorny...and clean it a bit...
2022-01-18 11:02:21 -08:00
John D Pell 9291b46b15 test_lib: update BATS to latest tag(s)
And fix any failing tests.
2022-01-10 00:27:39 -08:00
Noah Gorny f2bff34493
Merge pull request #2013 from gaelicWizard/completion/system
completion/system: load earlier than others
2022-01-09 01:13:23 +02:00