Skip to content

Commit

Permalink
Add --help and --version commands
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Apr 20, 2018
1 parent e06add1 commit 9a57ec8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cli.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ sub init {
print STDOUT "\nUsage: $self->{usage}\n\n";
print STDOUT "$self->{description}\n\n";
print STDOUT "Options:\n";
print STDOUT "\t[--help] or [--h] Output usage and all available options with description\n";
print STDOUT "\t[--version] or [--v] Ouput the CLI version\n";
foreach my $command (keys %{ $self->{commands} }) {
my $description = $self->{commands}->{$command}->{description} || "";
my $required = $self->{commands}->{$command}->{required} ? "Mandatory" : "Optional";
Expand Down

0 comments on commit 9a57ec8

Please sign in to comment.