mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-14 07:29:12 +08:00
revert alias.cmd changes
This commit is contained in:
parent
ac2082d56d
commit
67b374ad37
42
vendor/bin/alias.cmd
vendored
42
vendor/bin/alias.cmd
vendored
@ -48,9 +48,6 @@ goto parseargument
|
|||||||
set _x=%*
|
set _x=%*
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
echo _x=%_x%
|
|
||||||
|
|
||||||
rem #endregion parseargument
|
rem #endregion parseargument
|
||||||
|
|
||||||
if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" (
|
if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" (
|
||||||
@ -66,41 +63,18 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: create with multiple parameters
|
:: validate alias
|
||||||
if [%1] == [create] (
|
for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do (
|
||||||
if not [%2] == [] (
|
|
||||||
if not [%3] == [] (
|
|
||||||
set _x=%1=%2
|
|
||||||
:: if command create was submitted
|
|
||||||
set alias_name=%~2
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
echo %*
|
|
||||||
set alias_value=%*
|
|
||||||
|
|
||||||
for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do (
|
|
||||||
set alias_name=%%H
|
|
||||||
set alias_value=%%I
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
:: validate alias
|
|
||||||
echo %_x%
|
|
||||||
set x=!_x:%=^^%!
|
|
||||||
echo !_x!
|
|
||||||
for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do (
|
|
||||||
set alias_name=%%G
|
set alias_name=%%G
|
||||||
set alias_value=%%H
|
set alias_value=%%H
|
||||||
)
|
|
||||||
|
|
||||||
:: leading quotes added while validating
|
|
||||||
set alias_name=!alias_name:~1!
|
|
||||||
|
|
||||||
:: trailing quotes added while validating
|
|
||||||
set alias_value=!alias_value:~1,-1!
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:: leading quotes added while validating
|
||||||
|
set alias_name=%alias_name:~1%
|
||||||
|
|
||||||
|
:: trailing quotes added while validating
|
||||||
|
set alias_value=%alias_value:~0,-1%
|
||||||
|
|
||||||
::remove spaces
|
::remove spaces
|
||||||
set _temp=%alias_name: =%
|
set _temp=%alias_name: =%
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user