App-Sqitch

 view release on metacpan or  search on metacpan

lib/App/Sqitch/Command/config.pm  view on Meta::CPAN

package App::Sqitch::Command::config;

use 5.010;
use strict;
use warnings;
use utf8;
use Path::Class ();
use Try::Tiny;
use Locale::TextDomain qw(App-Sqitch);
use App::Sqitch::X qw(hurl);
use List::Util qw(first);
use Moo;
use App::Sqitch::Types qw(Str Dir Maybe);
use Type::Utils qw(enum);
use namespace::autoclean;
extends 'App::Sqitch::Command';

our $VERSION = 'v1.6.1'; # VERSION

has file => (
    is      => 'ro',
    lazy    => 1,
    default => sub {
        my $self = shift;
        my $meth = ( $self->context || 'local' ) . '_file';
        return $self->sqitch->config->$meth;
    }
);

has action => (
    is  => 'ro',
    isa => enum([qw(
        get
        get_all
        get_regex
        set
        unset
        list
        edit
        add
        replace_all
        unset_all
        rename_section
        remove_section
    )]),
);

has context => (
    is  => 'ro',
    isa => Maybe[enum([qw(
        local
        user
        system
    )])],
);

has type => ( is => 'ro', isa => enum( [qw(int num bool bool-or-int)] ) );

sub options {
    return qw(
        file|config-file|f=s
        local
        user|global
        system

        int
        bool
        bool-or-int
        num

        get
        get-all
        get-regex|get-regexp
        add
        replace-all



( run in 0.820 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )