Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
perl: [ '5.32', '5.36', '5.38' ]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}

- name: Install cpanm
run: cpanm --notest App::cpanminus

- name: Install dependencies
run: cpanm --notest --installdeps .

- name: Build
run: |
perl Build.PL
./Build

- name: Run tests
run: ./Build test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Build
_build/
blib/
MYMETA.*
*.bak
*.swp
**/#*#
**/*~
*.tar.gz
23 changes: 23 additions & 0 deletions Build.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use strict;
use warnings;
use Module::Build;

my $build = Module::Build->new(
module_name => 'Term::ReadLine::Repl',
license => 'perl',
dist_author => 'John R. <johnlradford23@gmail.com>',
requires => {
'perl' => '5.010',
'Data::Dumper' => 0,
'JSON' => 0,
'Term::ANSIColor' => 0,
'Term::ReadLine' => 0,
'Carp' => 0,
},
build_requires => {
'Module::Build' => 0,
'Test::Exception' => 0,
},
);

$build->create_build_script();
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.0.1] - 2026-03-13

### Added

- Initial release of `Term::ReadLine::Repl`.
- Basic REPL loop with prompt, welcome message, and `help`/`quit` built-in commands.
- Tab auto-completion for command names and their defined arguments.
- Argument validation in `validate_args()` with descriptive croak messages for
missing or malformed constructor args.
- `get_opts` support for integrating a `Getopt::Long` parsing function into the loop.
- `custom_logic` hook allowing callers to inject mid-loop logic, control flow
(`next`/`last`), and dynamic `cmd_schema` changes.
- `passthrough` option to forward `!command` input directly to the system shell.
- Persistent command history via `hist_file`.
- `Build.PL` for distribution build and dependency management.
- `META.yml` and `MANIFEST` for CPAN packaging.
- Full POD documentation including constructor args, methods, built-in commands,
and tab completion behaviour.
- Test suite covering `validate_args` croak paths, construction sanity checks,
and `_tab_complete` behaviour.
8 changes: 8 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Build.PL
example.pl
lib/Term/ReadLine/Repl.pm
MANIFEST This list of files
META.json
META.yml
Readme.md
t/01_basic.t
15 changes: 15 additions & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!include_default
# Avoid configuration metadata file
^MYMETA\.

# Avoid Module::Build generated and utility files.
\bBuild$
\bBuild.bat$
\b_build
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$
^MANIFEST\.SKIP

# Avoid archives of this distribution
\bTerm-ReadLine-Repl-[\d\.\_]+
53 changes: 53 additions & 0 deletions META.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"abstract" : "A batteries included interactive Term::ReadLine REPL module",
"author" : [
"John R. <johnlradford23@gmail.com>"
],
"dynamic_config" : 1,
"generated_by" : "Module::Build version 0.4231",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "Term-ReadLine-Repl",
"prereqs" : {
"build" : {
"requires" : {
"Module::Build" : "0",
"Test::Exception" : "0"
}
},
"configure" : {
"requires" : {
"Module::Build" : "0.42"
}
},
"runtime" : {
"requires" : {
"Carp" : "0",
"Data::Dumper" : "0",
"JSON" : "0",
"Term::ANSIColor" : "0",
"Term::ReadLine" : "0",
"perl" : "5.010"
}
}
},
"provides" : {
"Term::ReadLine::Repl" : {
"file" : "lib/Term/ReadLine/Repl.pm",
"version" : "v0.0.1"
}
},
"release_status" : "stable",
"resources" : {
"license" : [
"http://dev.perl.org/licenses/"
]
},
"version" : "v0.0.1",
"x_serialization_backend" : "JSON::PP version 4.06"
}
31 changes: 31 additions & 0 deletions META.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
abstract: 'A batteries included interactive Term::ReadLine REPL module'
author:
- 'John R. <johnlradford23@gmail.com>'
build_requires:
Module::Build: '0'
Test::Exception: '0'
configure_requires:
Module::Build: '0.42'
dynamic_config: 1
generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Term-ReadLine-Repl
provides:
Term::ReadLine::Repl:
file: lib/Term/ReadLine/Repl.pm
version: v0.0.1
requires:
Carp: '0'
Data::Dumper: '0'
JSON: '0'
Term::ANSIColor: '0'
Term::ReadLine: '0'
perl: '5.010'
resources:
license: http://dev.perl.org/licenses/
version: v0.0.1
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
Loading
Loading