diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 1a1739d..8e10d1d 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -48,6 +48,9 @@ goto parseargument set _x=%* ) ) + +echo _x=%_x% + rem #endregion parseargument if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( @@ -63,18 +66,41 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( ) ) -:: validate alias -for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do ( - set alias_name=%%G - set alias_value=%%H +:: create with multiple parameters +if [%1] == [create] ( + 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_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 set _temp=%alias_name: =% diff --git a/vendor/user_profile.ps1.default b/vendor/user_profile.ps1.default index 27cc47b..8ed5b81 100644 --- a/vendor/user_profile.ps1.default +++ b/vendor/user_profile.ps1.default @@ -23,20 +23,19 @@ ## -# Delete default powershell aliases that conflict with bash commands -# If you prefer the powershell aliases remove this. -if (get-command git) { - del -force alias:cat - del -force alias:clear - del -force alias:cp - del -force alias:diff - del -force alias:echo - del -force alias:kill - del -force alias:ls - del -force alias:mv - del -force alias:ps - del -force alias:pwd - del -force alias:rm - del -force alias:sleep - del -force alias:tee -} +# # Delete default powershell aliases that conflict with bash commands +# if (get-command git) { +# del -force alias:cat +# del -force alias:clear +# del -force alias:cp +# del -force alias:diff +# del -force alias:echo +# del -force alias:kill +# del -force alias:ls +# del -force alias:mv +# del -force alias:ps +# del -force alias:pwd +# del -force alias:rm +# del -force alias:sleep +# del -force alias:tee +# }