Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Nice alias display

Jun
137
3
(Update: I forgot to add that I'm using 4nt 6.01.245U on XP SP3. Yeah, I know, way out of date. But it is what it is.)

I'm trying to create an alias that will display an alias that has multiple lines in it, broken up by %+ characters, in a nicer form, where it will display it visually. I created the following:

Code:
DisplayAlias=echo %@replace[%=%+,%@char[13]%@char[10],%@execstr[alias %$]]
which has the effect of only displaying up to the first line break. Here's a test case:

Code:
->alias merge
unset /q _Arg1 _Arg2 %+ iff (%@right[1,%@word[0,%$]]) == (:) then %+ set _Arg1=%@word[0,%$].%+ else %+ set _Arg1="%@full[%@word[0,%$]]"%+ endiff %+ iff (%@right[1,%@word[1,%$]]) == (:) then %+ set _Arg2=%@word[1,%$].%+ else %+ set _Arg2="%@full[%@word[1,%$]]"%+ endiff %+ for /l %n in (1,1,10) if %@eval[%@ready[%_Arg1] + %@ready[%_Arg2]] != 2 (dir %_Arg1 %_Arg2 >& nul %+ echo Sleeping (%n) while waiting for %@left[2,%@full[%_Arg1]] and/or %@left[2,%@full[%_Arg2]] %+ delay 1) %+ iff %@ready[%_Arg1] != 1 then %+ echo Timed out waiting for %@left[2,%@full[%_Arg1]] %+ elseiff %@ready[%_Arg2] != 1 then %+ echo Timed out waiting for %@left[2,%@full[%_Arg2]] %+ else %+ Compare_Program %_Arg1 %_Arg2 %+ endiff %+ unset /q _Arg1 _Arg2
 
->displayalias merge
unset /q _Arg1 _Arg2
I would have thought it should display something like:

Code:
unset /q _Arg1 _Arg2 
 iff (%@right[1,%@word[0,%$]]) == (:) then 
 set _Arg1=%@word[0,%$].
 else 
 set _Arg1=%@full[%@word[0,%$]]
 endiff 
 iff (%@right[1,%@word[1,%$]]) == (:) then 
 set _Arg2=%@word[1,%$].
 else 
 set _Arg2=%@full[%@word[1,%$]]
 endiff 
 for /l %n in (1,1,10) if %@eval[%@ready[%_Arg1] + %@ready[%_Arg2]] != 2 (dir %_Arg1 %_Arg2 >& nul 
 echo Sleeping (%n) while waiting for %@left[2,%@full[%_Arg1]] and/or %@left[2,%@full[%_Arg2]] 
 delay 1) 
 iff %@ready[%_Arg1] != 1 then 
 echo Timed out waiting for %@left[2,%@full[%_Arg1]] 
 elseiff %@ready[%_Arg2] != 1 then 
 echo Timed out waiting for %@left[2,%@full[%_Arg2]] 
 else 
 Compare_Program %_Arg1 %_Arg2 
 endiff 
 unset /q _Arg1 _Arg2

What's wrong with my DisplayAlias alias?
 

Similar threads

Back
Top