From 73ec3342727953ff31ecb4f826a76eca667c3c22 Mon Sep 17 00:00:00 2001 From: Andreas Hrubak Date: Sun, 4 Aug 2024 14:54:35 +0200 Subject: [PATCH] new tool: args2env --- user-tools/Makefile.lists.mk | 1 + user-tools/args2env | 85 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100755 user-tools/args2env diff --git a/user-tools/Makefile.lists.mk b/user-tools/Makefile.lists.mk index 7690642..dd3d219 100644 --- a/user-tools/Makefile.lists.mk +++ b/user-tools/Makefile.lists.mk @@ -2,6 +2,7 @@ TOOLS ?= \ 2opml \ a8e \ adr2html \ + args2env \ asterisk-log-separator \ autosshfs-mount \ awk-cut \ diff --git a/user-tools/args2env b/user-tools/args2env new file mode 100755 index 0000000..4910dac --- /dev/null +++ b/user-tools/args2env @@ -0,0 +1,85 @@ +#!/usr/bin/env perl + +=pod + +=head1 NAME + +args2env - Turns command arguments into environment variables and executes command with the remained arguments + +=head1 SYNOPSIS + +args2env [I] I I I ... I I + +=head1 DESCRIPTION + +=head1 OPTIONS + +=over 4 + +=item -a, --arg I + +Move the Ith argument to the environment by the name B<< ARG_I >> +(may be overridden by B<--template> option). +Counting starts from 1. +I may be negative number, in which case it's counted from the end backwards. + +=item -ra, --right-arg I + +Same as B<< --arg -I >>. + +=item -t, --template I