\def\getargsversionnumber{v1.01}
\ProvidesPackage{getargs}
[2016/05/20 \getargsversionnumber\ 
 Macro to parse an argument list, using user-specified parsing character]
% CREATED BY Steven B. Segletes <steven.b.segletes.civ@mail.mil>
% THIS PACKAGE IS RELEASED IN ACCORDANCE WITH THE LaTeX PUBLIC PROJECT LICENSE
% LPPL v1.3c (http://ctan.org/license/lppl1.3) OR ITS SUCCESSORS

% V1.00-Initial release
\newcounter{getarg@ctr}
\let\getargs\relax
\newcommand\getargs{}

\newcommand\setparsechar[1]{%
  \def\getargparsechar{#1}%
  \renewcommand{\getargs}[1]{%
    \setcounter{getarg@ctr}{0}%
    \parse@args##1#1\relax\relax%
  }%
  \def\parse@args##1#1##2\relax{%
    \stepcounter{getarg@ctr}%
    \expandafter\gdef\csname\getarg@root\romannumeral\value{getarg@ctr}\endcsname{##1}%
    \ifx\relax##2\relax%
      \expandafter\xdef\csname n\getarg@root\endcsname{\thegetarg@ctr}\else%
        \parse@args##2\relax\fi%
  }%
}

\newcommand\setparserootname[1][arg]{\def\getarg@root{#1}}

\let\showargs\relax
\newcommand\showargs[1][t]{%
  \fboxrule=.7pt\relax\fboxsep=\dimexpr-.5pt-\fboxrule\relax%
  \csname n\getarg@root\endcsname{} \textbackslash\getarg@root\ldots{} items %
    \if x#1(expanded)\else (tokens)\fi%
  : \showargs@help{#1}{1}{\csname n\getarg@root\endcsname}\unskip\fbox{\strut}.%
}

\newcommand\showargs@help[3]{%
  \setcounter{getarg@ctr}{#2}%
  \if x#1%
    \fbox{\strut}\csname\getarg@root\romannumeral\value{getarg@ctr}\endcsname%
    \hskip0pt\relax%
  \else
    \fbox{\strut}%
      \expandafter\detokenize\expandafter\expandafter\expandafter{%
      \csname\getarg@root\romannumeral\value{getarg@ctr}\endcsname}\hskip0pt\relax%
  \fi
  \ifnum\value{getarg@ctr}<#3\relax\stepcounter{getarg@ctr}%
    \showargs@help{#1}{\thegetarg@ctr}{#3}%
  \fi%
}

\setparserootname
\setparsechar{,}
\endinput
