1. Mateu Hunter
  2. p5-p5u

Commits

Toby Inkster  committed 885095f

override App::Cmd's default 'commands' command

  • Participants
  • Parent commits 84b7e58
  • Branches default

Comments (0)

Files changed (1)

File lib/P5U/Command/Commands.pm

View file
+package P5U::Command::Commands;
+
+use 5.010;
+use strict;
+use utf8;
+use P5U-command;
+
+require App::Cmd::Command::commands;
+our @ISA = 'App::Cmd::Command::commands';
+
+BEGIN {
+	$P5U::Command::Commands::AUTHORITY = 'cpan:TOBYINK';
+	$P5U::Command::Commands::VERSION   = '0.001';
+};
+
+use constant {
+	abstract    => q[list installed p5u commands],
+};
+
+sub sort_commands
+{
+	my ($self, @commands) = @_;
+	my $float = qr/^(?:help|commands|aliases)$/;
+	my @head = sort grep { $_ =~ $float } @commands;
+	my @tail = sort grep { $_ !~ $float } @commands;
+	return (\@head, \@tail);
+}
+1;