'format' => $ENV{$UC_NAME.'_FORMAT'} ? $ENV{$UC_NAME.'_FORMAT'} : 'json',
'action' => $ENV{$UC_NAME.'_ACTION'} ? $ENV{$UC_NAME.'_ACTION'} : 'rows',
);
+my @CURL_OPT = (
+ 'dump-header|D=s',
+ 'get|G!',
+);
+
+my %CMD_ALIASE = (
+ 'f' => 'format',
+ 't' => 'table',
+ 'a' => 'action',
+ 'l' => 'limit',
+);
+
#################################################################################
#
csv2txt("\t",shift @ARGV) if @ARGV and $ARGV[0] eq '--csv2txt' and shift @ARGV;
curl_help() if @ARGV and $ARGV[0] eq '--curl_help' and shift @ARGV;
-my @curl_opt = (
- 'dump-header|D=s',
- 'get|G!',
-);
-
-my %Opt; get_options(\%Opt,\@curl_opt);
+my %Opt; get_options(\%Opt,\@CURL_OPT);
#use Data::Dumper; die Dumper(\%Opt);
-for (@curl_opt) {
+for (@CURL_OPT) {
s/\|.*$//;
next unless $Opt{$_};
if ($Opt{$_} ne '1') {
while ($_ = shift @ARGV) {
if (/^([^=]+)=(.*)$/) {
- $keys{$1} = $2;
+ $keys{($CMD_ALIASE{$1} ? $CMD_ALIASE{$1} : $1)} = $2;
} else {
push(@cmd,$_);
}