ELGETOPT(1)
π elgetopt(1) β the General Commands Manual, but make it group chat
okay so bestie, welcome to elgetopt π this is the elgetopt(1) page and honestly it's giving "tiny tool, huge personality".
β¨ NAME β¨
elgetopt β perform getopt-style parsing on the arguments to an execline script π (yes, that's literally the whole job, and it does it slayfully)
β¨ SYNOPSIS β¨
elgetopt [-D default] optstring prog...
π¦ DESCRIPTION π¦
so here's the vibe check first: elgetopt expects to find a valid number n of arguments in the # environment variable, plus n+1 environment variables 0, 1, ..., n. and if that's not the case? it exits 100. no cap, that's the deal. π
then elgetopt pushes environment variables (cf. execline-pushenv(7)) starting with ELGETOPT_. and if you want the previous values back, you literally just use emptyenv -o. iconic. π«Ά
elgetopt looks into 1, 2, ... for options, as specified by optstring, which is a standard getopt(1) string. periodt.
if the -c switch is recognized, elgetopt sets the ELGETOPT_c environment variable. the value of that variable is the argument to the -c switch if it has one, and 1 (or default if given) otherwise. β¨
after setting all recognized options, elgetopt makes new #, 1, 2, ... "positional parameters" with whatever remains. leftovers but make them fashion. π
then elgetopt execs into prog... π
β οΈ GNU-style options are not supported. bestie please, don't come at it with --long-option, it will not eat that. π
πΈ OPTIONS πΈ
-D defaultβ use default as the value for theELGETOPT_cenvironment variable if there is no argument to the-cswitch. Default is1. the value is the same for all the options defined byelgetopt. (one value to rule them all π )
π₯ SEE ALSO π₯
dollarat(1), getopt(1), shift(1), execline-pushenv(7)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/elgetopt.html
π AUTHORS π
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)
and that's the whole thing, bestie π this cutie was brought to you by Debian, dated April 3, 2023 β mwah, go parse some args, iykyk ππ§π
π¦ where this page comes from
- nixpkgs unstable: execline 2.9.9.2
- nixpkgs unstable: execline-man-pages 2.9.9.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms