package Gruntmaster::App::Command::Get;

use 5.014000;
use warnings;

our $VERSION = '5999.000_004';

use Gruntmaster::App '-command';
use Gruntmaster::Data;

sub usage_desc { '%c [-cjpu] get id column' }

sub validate_args {
	my ($self, $opt, $args) = @_;
	my @args = @$args;
	$self->usage_error('No table selected') unless $self->app->table;
	$self->usage_error('Wrong number of arguments') if @args != 2;
}

sub execute {
	my ($self, $opt, $args) = @_;
	my ($obj, $col) = @$args;
	say db->select($self->app->table, $col, {id => $obj})->flat
}

1;
__END__
