feat(options): add --lxsh option to force lxsh parse
This commit is contained in:
parent
fe7e6cdb52
commit
bce1d4b455
2 changed files with 9 additions and 1 deletions
|
|
@ -94,7 +94,14 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
first_run=false;
|
first_run=false;
|
||||||
// resolve shebang
|
// resolve shebang
|
||||||
if(options["bash"])
|
if(options["lxsh"])
|
||||||
|
{
|
||||||
|
shebang_is_bin = true;
|
||||||
|
parse_bash = true;
|
||||||
|
binshebang = basename(shebang);
|
||||||
|
shebang = "#!/usr/bin/env lxsh";
|
||||||
|
}
|
||||||
|
else if(options["bash"])
|
||||||
{
|
{
|
||||||
parse_bash=true;
|
parse_bash=true;
|
||||||
shebang = "#!/usr/bin/env bash";
|
shebang = "#!/usr/bin/env bash";
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ ztd::option_set options( {
|
||||||
ztd::option('R', "no-resolve", false, "Don't resolve %resolve commands"),
|
ztd::option('R', "no-resolve", false, "Don't resolve %resolve commands"),
|
||||||
ztd::option("no-extend", false, "Don't add lxsh extension functions"),
|
ztd::option("no-extend", false, "Don't add lxsh extension functions"),
|
||||||
ztd::option("bash", false, "Force bash parsing"),
|
ztd::option("bash", false, "Force bash parsing"),
|
||||||
|
ztd::option("lxsh", false, "Force lxsh parsing"),
|
||||||
ztd::option("debashify", false, "Attempt to turn a bash-specific script into a POSIX shell script"),
|
ztd::option("debashify", false, "Attempt to turn a bash-specific script into a POSIX shell script"),
|
||||||
ztd::option("remove-unused", false, "Remove unused functions and variables"),
|
ztd::option("remove-unused", false, "Remove unused functions and variables"),
|
||||||
ztd::option("list-cmd", false, "List all commands invoked in the script"),
|
ztd::option("list-cmd", false, "List all commands invoked in the script"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue