0.060000 -- 2024-09-06
Term::CLI::Role::HelpText
- Prevent very long usage lines with sub-commands.
Replace a long list of sub-commands with I<sub-command>.
Term::CLI::L10N/nl.pm
- Fix missing ')' in translation of help text.
Term::CLI::Command
- Fixes to _check_arguments (Term::CLI::Command)
Remove trailing space from error message and change quoting
to use double quotes inside the message.
0.059000 -- 2022-01-14
- Handle negatable options in completion and help text (closes #27)
- Term::CLI::Intro
- Restructure & expand class summary.
- Restructure the headings a bit, add the Tree and TypeTiny
argument types.
- examples/state_demo.pl
- Fix doc string for "borrow".
0.058002 -- 2022-08-22
[Bug fixes]
Term::CLI::Argument::TypeTiny
- Small POD fixes (mostly to pass pod coverage).
0.058001 -- 2022-07-21
Acknowledgements to djerius for contributing Term::CLI::Argument::Tree
and Term::CLI::Argument::TypeTiny.
[Enhancements]
Term::CLI::Argument::TypeTiny [djerius]
- Argument which validates/coerces against Type::Tiny types.
Term::CLI::Argument::Tree [djerius]
- Hierarchical/tree argument type
[Building / Testing / Packaging]
- Shift numbers in unit tests to accomodate new tests.
- Add a build script for Fedora RPMs.
- Add a build script for Debian DEBs.
0.057001 -- 2022-04-20
Acknowledgements to djerius for various fixes, enhancements, and
suggestions (see git log for full details).
[Enhancements]
Term::CLI::Argument::Enum [djerius]
- Minor optimizations to Term::CLI::Argument::Enum cache.
Term::CLI, Term::CLI::Command::Help
- Move pager logic from `Help` command to `CLI` object (add
`write_pager` method).
CLI::Base
- Move `parent` and `root_node` to CLI::Base.
[Bug fixes]
Term::CLI::ReadLine
- Fix signal restoration (`local(%SIG) = %SIG` does not work).
Term::CLI::Command::Help
- Fix missing ')' in help text.
[Documentation fixes]
- Change references in documentation from M6::CLI
to Term::CLI [djerius]
- Miscellaneous POD fixes.
[Miscellaneous]
- Lower dependencies for Test::MockModule and Capture::Tiny.
- Lower dependency on Term::ReadKey for older system Perls.
0.056001 -- 2022-04-12
[Enhancements]
Term::CLI::Command, Term::CLI::Command::Help,
Term::CLI::Element, Term::CLI::Role::CommandSet
- Consistent state between `processed` and `validate`/`execute`
The state passed to `complete` and `execute_command` (and, by extension
the argument's `validate` methods) differs in subtle ways. Try to make
them more consistent by:
* For `complete`: the `processed` key in the state information
now points to a list of hashes instead of strings.
The hashes have an `element` key (ref. to relevant command or
argument object) and a `value` key (the literal value provided
in the inpug).
* For `execute_command` and `validate`: the state given to these
methods now also contains a `processed` key.
Semantics are the same as for `complete`, except that the
`value` keys of the elements contain the *validated* values, i.e.
they can be converted, expanded, or otherwise normalised.
[Bug fixes]
- Term::CLI::Command
POD fix: reference to "execute" -> "execute_line".
- Term::CLI::Tutorial
Convert TABs to spaces.
0.055002 -- 2022-02-14
[Bug fixes]
- benchmarks/grep_vs_search.pl
Fix duplicate '-i' option in `grep_vs_search.pl`.
- t/*
Work around GNU readline interaction with xterm. Tests can fail if GNU
readline is told to use STDIN/STDOUT: it may inadvertently output a
`ESC-[?1034h` sequence ("interpret Meta key, enable 8-bit input"), which
does not play well with our `Test::Output` tests.
To avoid this, we specify `filehandles => []` to the `Term::CLI`
constructor.
So far this only manifested itself on OpenBSD 7.0, and only on the
i386 build of that. Still, I want my tests to pass...
[Building / Testing]
- Leave POD test prereqs out of the distribution.
- Improve test coverage (also add tests for `Term::CLI::Util`).
- Fix enviroment testing for skipping tests.
The `Test::Class` `SKIP_ALL` method does not work as advertised.
[Enhancements]
Term::CLI::Util
Make find_* routines a little faster. The `last if ...` check
when iterating over possible matches is not necessary. A simple
unqualified `last` will do.
Term::CLI::Argument::Filename
- Promote `_glob_complete` to `glob_complete`.
0.055001 -- 2022-02-12
[Enhancements]
- Context-sensitive Completion / Validation
`complete` methods now receive a second argument: a HashRef
with "state" information that includes the preceding words on
the command line (in the `$state->{processed}` ArrayRef) and a
collection of options seen so far (in the `$state->{options}`
HashRef).
Argument validators also receive a "state" parameter HashRef
(although it has a different different structure than that of
`complete`, see documentation).
See the demo script in `examples/context_sensitive_completion/`.
- Dynamic Enum Arguments
The `value_list` of Term::CLI::Argument::Enum objects now accepts
a CodeRef, which will be called when the list of values needs
to be fetched.
The new `values` method returns the actual list of values.
The `cache_values` boolean attribute can be used to to execute
the list expansion only once.
The tutorial has been updated to include this.
- Dynamic Command Lists
The `commands` argument of Term::CLI and Term::CLI::Commands
objects (through Term::CLI::Role::CommandSet) now accepts a
CodeRef, which will only be called the first time the command
list is needed. This allows for delayed command building,
which, if used in deeper levels of a command hierarchy, can
reduce start-up time.
A new `delete_command` method allows for dynamic command
hierarchies [RFE#16]. See `examples/dynamic_commands.pl` for
a demo of this.
- New `state` attribute for Term::CLI and Term::CLI::Command
These classes now use a new role called Term::CLI::Role::State
that provides a "state" HashRef that can be used to store
application-specific state.
- Term::CLI
Create a ReadLine object that uses `STDIN` and `STDOUT`
by default, instead of letting (Gnu) ReadLine find and open
the TTY separately. This ensures that:
perl readline_app < input_file
- will actually read input from `input_file`, while also
making sure that whatever encoding you have on the standard I/O
handles (e.g. `use open qw(:std :utf8)`) will also be applied
to ReadLine's I/O. This means that Estonians can write "tõsi"
for "true" and Macedonians can write "лажни" for "false".
- Term::CLI::Argument::Boolean
Completions now match the case of the partial text, so "TR"
gets completed to "TRUE" instead of "TRue".
- Term::CLI::Role::CommandSet
Command lists are now always sorted by name internally. This
allows for optimised searching/matching.
- Term::CLI::Argument::Enum
Value lists are always sorted internally. This allows for
optimised searching/matching, see also examples/big_enum.pl
[New]
- Term::CLI::Util
New module with a few utility functions for other modules.
- Term::CLI::Role::State
A `Moo::Role` that adds a `state` hash to objects.
See examples/state_demo.pl.
- benchmarks/*
A few scripts with benchmarks for different approaches to
particular algorithms.
- examples/cli_context.pl
Demo script for CLI context (provided by djerius).
[Tests]
- Various updates and fixes to test the new functionalities.
[Bug Fixes]
- Term::CLI::Argument::Bool
- Fix case-sensitive completion (used `lc` where we shouldn't).
- Fix test cases for case-insenstive (enum) completion.
- tutorial/example_17_suspend.pl
Don't suspend if there was an error on the command line input.
- Fix Boolean bug in tutorial (and accompanying code).
We specified "1" as a valid value for "false"; that should be "0".
[Miscellaneous]
- Eliminate unnecessary `shift` of function argument in favour
of assigning from `@_`.
- Improve Dutch translation of "unknown (sub-)command"
- Fix dependency on Test::MockModule so it builds on FreeBSD 12.
- POD fixes and updates.
- Term::CLI::Command
Modify error message for invalid arguments for readability.
0.054002 -- 2022-01-05
[Testing]
- Fix test for help command.
Take into account that help text can be rendered using overstrike.
Files modified:
t/065-Term-CLI-Command-Help.t
0.054001 -- 2022-01-04
[Code Cleanup]
- Tests and modules pass perlcritic's "stern" (-4) filter.
- Apply perltidy.
- Properly localise %SIG in `readline`.
- POD fixes.
- Remove unnecessary `else` and `elsif`.
- Run code through perltidy.
- Eliminate some unnecessary else/elsif.
- Remove default export of `loc` from `Term::CLI::L10N`
Explicitly import `loc` in all modules that need it.
- Do not use `package Foo {}` syntax.
All modules have only one `package`, so the block syntax
doesn't add anything and causes perltidy to unnecessarily
indent all code.
[Enhancements]
- Improve filename completion for non-GNU readline
The glob variation now uses a trick when completing directory
names that prevents the readline module from adding a space.
Files modified:
lib/Term/CLI/Argument/Filename.pm
- Add CONTRIBUTING.md, Contributors; fix README
- Add a `clear_error` method to Term::CLI::Base
and use it instead of `set_error('')`.
[Bug Fixes]
- Fix potential bug in line splitting (Term::CLI).
- Work around for old Pod::Text::Termcap, closes #12
Versions of `Pod::Text::Termcap` before 4.11 had a bug (#124447)
that resulted in it using a screen width of 80, regardless of what
was specified in the constructor call or environment. As a result,
the high `=over` indents could cause very strange output or even
make `Pod::Text::Termcap` spin into an eternal loop.
To make life easier for those with older Perl installations,
we test for the older `Pod::Text::Termcap` version and use
`Pod::Text::Overstrike` instead if necessary. The overstrike
variant does not contain the screen width bug, although it does
require a pager that understands overstrike sequences. The default
pager for `Term::CLI` (`less`) does, so the invonvenience should
be minor.
Thanks to djerius for reporting and diagnosing the problem.
Files modified:
lib/Term/CLI/Command/Help.pm
0.053006 -- 2021-12-27
[Compatibility]
- Fix versions of used modules for Perl 5.14.1
If we claim to to be compatible with Perl 5.14, then we should
make sure that the minimum required version of modules included
in the default distribution match up with what we require.
Files modified:
lib/**/*.pm
t/**/*.t
- Use `bsd_glob` instead of `:bsd_glob`
`File::Glob` in Perl 5.14 didn't have the `:bsd_glob` tag yet.
Since we only need the `bsd_glob()` function, just import the
function.
Files modified:
lib/Term/CLI/Argument/Filename.pm
[Bug Fixes]
- Term::CLI::ReadLine
- Make sure Term::ReadKey uses a "TTY" filehandle.
In cases of e.g. automated runs, STDIN and STDOUT may be
redirected. `Term::ReadLine` can handle that, `Term::ReadKey`
cannot, so we need to be explicit.
- Minor POD fixes.
0.053005 -- 2021-12-23
- Validate keyboard signal names before using them.
Files modified:
lib/Term/CLI/ReadLine.pm
- Add back the dependency on Term::ReadLine::Gnu
Tests will break on MSWIN if the ::Perl backend is chosen.
Files modified:
dist.ini
0.053004 -- 2021-12-23
[Bug Fixes]
- Don't use `state` hash; not supported on older Perls
Use `state $xx = { ... }` instead.
Files modified:
lib/Term/CLI/ReadLine.pm
0.053003 -- 2021-12-23
[Packaging]
- Remove author tests from MANIFEST.SKIP
0.053002 -- 2021-12-23
[Packaging]
- Fix MANIFEST.
0.053001 -- 2021-12-22
[Features]
- Now indepenent of Term::ReadLine implementation
I.e. compatible with Term::ReadLine::Perl and Term::ReadLine::Stub
as well (though Term::ReadLine::Gnu is still the best supported).
- Improved signal handling:
- Add `ignore_keyboard_signal`.
- Ignore QUIT control sequence (makes ::Gnu behave like ::Perl).
- Allow Term::CLI::Argument::Enum values to be provided dynamically
Term::CLI::Argument::Enum's value_list attribute may be a coderef,
which should return an array reference of valid values.
(Pull request #13 from djerius/dynamic-enum.)
- Add "cleanup" attribute.
[Tutorial]
- Formatting fixes.
- Add SIGNAL HANDLING section.
- Add HISTORY HANDLING section.
- Add tutorial/example_17_suspend.pl
- Use `local($SIG{...})` in `sleep` command.
[Refactoring]
- Move most history logic to Term::CLI::ReadLine
Term::CLI::ReadLine is much more of a compatibility layer
between Term::CLI and Term::ReadLine now, providing compatibility
code to compensate for missing functionality in the underlying
Term::ReadLine implementation.
[Bug Fixes]
- Fix Enum validation - closes #10
Enum validation finds potential matches to an argument by performing
prefix comparison against the list of valid values. This works fine
as long as the valid values are not prefixes of each other; if they
are, then the shorter strings will never be considered valid input.
- GNU ReadLine - exclude prompt ornaments for leading/trailing whitespace.
The Term::ReadLine::GNU implementation will just slap the prompt
between the ornament-start/ornament-end sequences, but this looks
ugly if there are leading/trailing spaces and the ornament is set
to e.g. underline or standout. This is now brought in line with how
the Term::ReadLine::Perl implementation handles it, by inserting
relevant escape sequences where necessary.
[Packaging]
- Various build fixes.
- Remove prereq on Term::ReadLine::Gnu.
0.052005 -- 2021-05-27
- Increase coverage of Term::CLI.
Files modified:
lib/Term/CLI.pm
t/055-Term-CLI.t
- Remove reference to Modern::Perl
Files modified:
lib/Term/CLI/Tutorial.pod
- Clean up `use` statements and `#!` in examples and tutorials.
Files modified:
examples/*
tutorial/*
0.052004 -- 2021-05-27
- Ignore; tagged without changelog, see 0.052005 instead.
0.052003 -- 2021-05-26
- Packaging fixes
- Get rid of Term::CLI::PerlFeatures again
CPANTS kwalitee indicator complains about missing `use strict`
and `use warnings`. :-(
- Add test coverage for `help --all --pod`
- CLI::Tutorial POD: fix link to "Term::CLI/History Control".
0.052002 -- 2021-05-19
- Packaging fixes.
- POD fixes.
- Get rid of `Modern::Perl` dependency (add `Term::CLI::PerlFeatures`)
- Force use of `Term::ReadLine::Gnu`
`Term::ReadLine` *always* looks at the `PERL_RL` environment variable.
This is a problem if your applications depends on not just
`Term::ReadLine`, but features of `Term::ReadLine::Gnu` in particular.
The way we can force the issue, is to make sure we override `PERL_RL`
before loading `Term::ReadLine`.
The workaround only works if `Term::ReadLine` has not been loaded by
another module yet.
Hopefully, this fixes the CPAN tests on FreeBSD as well.
0.052001 -- 2021-04-30
- Update copyright.
- Packaging fixes.
- Improve "help":
- Fix "help" test suite to fit new POD format.
- Add "--all" flag to "help" command.
- Refactor help text generation.
- POD fixes.
- Update tutorial.
- POD and whitespace fixes.
0.051007 -- 2019-11-18
- Get rid of bogus file "xx".
0.051006 -- 2019-11-18
- Add script to get current version.
Files added:
scratch/get_version.pl
- Autoincrement version if argument is +1.
Files modified:
scratch/fix_version_number.pl
- Do not try to load Term::ReadLine::Gnu directly.
Term::ReadLine::Gnu should not be loaded directly. Instead,
the Term::CLI::ReadLine->new method will check whether a
newly created Term::ReadLine object is of the "::Gnu" variety.
If not, it will call "Carp::confess()".
Files modified:
lib/Term/CLI/ReadLine.pm
0.051005 -- 2019-11-06
- Bad lexical scope for $has_terminator
Re-declared $has_terminator as "my" in the case
of Getopt::Long < 2.51, which made it pretty much a no-op.
Files modified:
lib/Term/CLI/Command.pm
- Fix BuildRequires and Provides in Fedora pkg spec.
Files modified:
pkg/fedora/perl-Term-CLI.spec
0.051004 -- 2019-11-05
- Work around changed Getopt::Long 2.51 behaviour
Getopt::Long 2.51 fixed its documented behaviour ("--" is kept
in the argument list if "pass_through" is specified). Previous
versions removed it. Term::CLI now checks for the Getopt::Long
version and adapts where necessary.
Files modified:
lib/Term/CLI/Command.pm
- Add perl-generators to BuildRequires
Files modified:
pkg/fedora/perl-Term-CLI.spec
- Fix hint on tagging/pushing.
Files modified:
RELEASING
0.051003 -- 2018-07-11
- POD fixes:
- Minor POD polishing.
Files modified:
lib/Term/CLI.pm
lib/Term/CLI/Command.pm
lib/Term/CLI/Intro.pod
- Fix ::Int -> ::Float in POD.
Files modified:
lib/Term/CLI/Argument/Number/Float.pm
- "bss>" -> "bssh>"
Files modified:
lib/Term/CLI/Tutorial.pod
- Fix examples.
Files modified:
lib/Term/CLI/Tutorial.pod
- fix missing comma on callback option
Files modified:
lib/Term/CLI.pm
0.051002 -- 2018-03-16
- Fix version number.
0.05002 might look like "0.05.2", but is in fact "0.50.20".
Insert a digit to make fix this: "0.051002" translates to
"0.51.2".
Files modified:
lib/**/*.pm
0.05002 -- 2018-03-16
[Bug Fixes]
- Don't "reset_after_signal" after re-throwing.
Files modified:
lib/Term/CLI.pm
0.05001 -- 2018-03-16
[Bug Fixes]
- Fix signal handling
- WINCH is now handled correctly.
- TTIN, TTOU, HUP, and TERM are now handled as well.
Files modified:
lib/Term/CLI.pm
- Fix heuristic =over determination.
Files modified:
lib/Term/CLI/Command/Help.pm
[Features]
- Expand tutorial(s).
Files modified:
tutorial/*.t
lib/Term/CLI/Tutorial.pod
[POD fixes]
- Term::CLI::L10N: Add EXAMPLES and DESCRIPTION.
- Term::CLI::Intro: Include L10N modules and Bool argument class.
- Term::CLI: Bring POD in line with code.
- Term::CLI::L10N::nl: its => it's
[Miscellaneous Changes]
- pkg/fedora/perl-Term-CLI.spec: Fix packager.
- lib/**/*.pm: Reduce length of "#==...==" lines.
- Update POD on signal handling.
Files modified:
lib/Term/CLI.pm
- Fix tutorial file names.
Files modified:
lib/Term/CLI/Tutorial.pod
- Update with dzil build.
Files modified:
MANIFEST
0.04009 -- 2018-03-14
- Use $^X to find current Perl interpreter.
Also, remove "#!" line from "fake pager".
Files modified:
t/065-Term-CLI-Command-Help.t
t/scripts/pager.pl
- Lower versions for FindBin, strict, subs, warnings.
Files modified:
t/*
lib/*
0.04008 -- 2018-03-13
[Bug Fixes]
- Fake pager should drain STDIN before exiting.
This should finally fix the failing test in
t/065-Term-CLI-Command-Help.t
Files modified:
t/scripts/pager.pl
[Other Changes]
- Better check and diagnostics for pager error.
Files modified:
t/065-Term-CLI-Command-Help.t
0.04007 -- 2018-03-13
[Bug Fixes]
- Try to add a "diag" to failing test.
Files modified:
t/065-Term-CLI-Command-Help.t
[Other Changes]
- $SIG instead of $::SIG.
Files modified:
lib/Term/CLI/Command/Help.pm
0.04006 -- 2018-03-12
[Other Changes]
- Lower min. version for Moo, drop Moo::Role version.
Files modified:
lib/**/*.pm
- Remove use of POSIX.
Files modified:
lib/Term/CLI/Argument/Number/Float.pm
Makefile.PL
cpanfile
0.04005 -- 2018-03-12
[Bug Fixes]
- Separate STDOUT/pager output for help a bit more.
Also, set "status" to $? regardless of close() result.
Some tests for status still fail, and I'm suspecting a
race condition, making close() return "true". If this
fails as well, then I'll just skip the test. :-(
Files modified:
lib/Term/CLI/Command/Help.pm
[Other Changes]
- Require specific versions of modules.
Minimal versions come from Debian jessie (8) install. Wheezy has
a version of "Moo" that is too old.
Files modified: (almost all)
- Use MetaProvides::Package in dist.ini
Files modified:
dist.ini
- Clean up MANIFEST and gitignore
Files modified:
MANIFEST.SKIP, MANIFEST, .gitignore
- Add script to extract RPM provides from PM files.
Files added:
scratch/get_rpm_provides.pl
- Fix dependencies and provides.
Files modified:
pkg/fedora/perl-Term-CLI.spec
0.04004 -- 2018-03-10
[Bug Fixes]
- Don't check STDERR on pager error.
Something's off in checking STDERR when running an external
pager. Could be race condition? Anyway, we only care about
propagation of the exit status, so just test that.
Tests work in my dev. environment, but fail about 30-50% of
the time on CPAN testers.
Files modified:
t/065-Term-CLI-Command-Help.t
t/scripts/pager.pl
0.04003 -- 2018-03-09
[Bug Fixes]
- Use custom script for pager error exit.
Running external commands in tests is not as easy
as it seems...
Files added:
t/scripts/pager.pl
Files modified:
t/065-Term-CLI-Command-Help.t
[Other Changes]
- Copy MANIFEST from D::Z build.
Files modified:
dist.ini
- Add MANIFEST from D::Z build.
Files added:
MANIFEST
0.04002 -- 2018-03-09
[Bug Fixes]
- Ignore SIGPIPE in _execute_help -- closes #5
Files modified:
lib/Term/CLI/Command/Help.pm
- Select raw STDOUT for help output.
Files modified:
t/065-Term-CLI-Command-Help.t
- Fix English-centred error message check.
Files modified:
t/075-Term-CLI-History.t
[Features]
- Allow empty "pager" (dump to STDOUT)
Instead of falling back to "cat", fall back to
raw STDOUT printing. An empty pager list will
select STDOUT as well.
Files modified:
lib/Term/CLI/Command/Help.pm
[Other Changes]
- Clean up commented-out code.
Files modified:
lib/Term/CLI/Command/Help.pm
0.04001 -- 2018-03-08
[Features]
- Multi-language support through Locale::Maketext.
Files: many
- Add min_len and max_len restrictions to
Term::CLI::Argument::String.
Files:
lib/Term/CLI/Argument/String.pm
- Improve usage text formatting.
Files:
lib/Term/CLI/Role/HelpText.pm
[New Modules]
- Add Term::CLI::L10N
- Add Term::CLI::L10N::en
- Add Term::CLI::L10N::nl
Files:
lib/Term/CLI/L10N.pm
lib/Term/CLI/L10N/en.pm
lib/Term/CLI/L10N/nl.pm
- Add Term::CLI::Argument::Bool
Files:
lib/Term/CLI/Argument/Bool.pm
[Bug Fixes]
- Fix various (POD and diagnostic message) typos.
- Don't use POSIX's strtod() and strtol() for number conversions;
rely on regex and looks_like_number() instead.
Files:
lib/Term/CLI/Argument/Number.pm
lib/Term/CLI/Argument/Number/Float.pm
lib/Term/CLI/Argument/Number/Int.pm
- Tests now force the 'en' language where necessary.
Error messages are hard to verify without forcing
a particular language.
Files:
lib/Term/CLI/Role/HelpText.pm
- Fix usage text with variable number of arguments.
Files:
lib/Term/CLI/Role/HelpText.pm
- Check SUPER's validate with defined(), not boolean eval.
Files:
lib/Term/CLI/Argument/Enum.pm
- Fix "=over" size in command summary to a maximum.
Files:
lib/Term/CLI/Command/Help.pm
- Fix test on FreeBSD - closes #2
Error message from "cat" on invalid option differs from
Linux to FreeBSD. Just check for "cat:" in the error
message instead.
Files:
t/065-Term-CLI-Command-Help.t
- Fix tests for non-English locales - closes #3
Tests were assuming that external commands
communicate their diagnostics in English.
Files:
t/065-Term-CLI-Command-Help.t
t/075-Term-CLI-History.t
- Turn off "-T"
Files:
t/065-Term-CLI-Command-Help.t
0.03002 -- 2018-02-26
[Bug Fixes]
- Fix float comparision in test -- fixes #1
On Perl installs compiled with -Duselongdouble,
1.23e-4 is 0.000123000000000000008, not 0.000123.
- dist.ini: add dependencies not picked up by AutoPrereqs
[Other Changes]
- Update version and dependencies.
0.03001 -- 2018-02-26
- Switch to using Dist::Zilla.
- Some code cleanups (remove unnecessary "use" clauses).
- Fix some POD pages.
0.02 -- 2018-02-24
- Fix version numbers: package Foo 0.02 { ... }
0.01 -- 2018-02-24
- First release.