Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging #23

Open
lazna opened this issue Nov 3, 2019 · 3 comments
Open

Debugging #23

lazna opened this issue Nov 3, 2019 · 3 comments

Comments

@lazna
Copy link
Collaborator

@lazna lazna commented Nov 3, 2019

What about to add some command to enable easily script debugging? Thinking about something like this:

  • take script line
  • execute command
  • display used variables
  • (optionaly) execute pause command
@adoxa

This comment has been minimized.

Copy link
Collaborator

@adoxa adoxa commented Nov 4, 2019

* take script line

If that's what I think you mean, it's already done.

c:\Projects\enhancedbatch>type error.bat
@echo off
rundll32.exe %~dp0enhancedbatch_%processor_architecture%.dll,load
set /a

c:\Projects\enhancedbatch>error.bat
error.bat:3: The syntax of the command is incorrect.

That's the default; it can also display the full path or be turned off.

* execute command

Not sure what you mean.

* display used variables

Do you mean like set, but only for variables used up to this point? Does "used" mean set, or accessed as well? Is the intention to include the line where it was set/accessed? Not sure, that seems a fair bit of work for little result.

* (optionaly) execute pause command

Do you mean between each command?

@lazna

This comment has been minimized.

Copy link
Collaborator Author

@lazna lazna commented Nov 4, 2019

Its just my guess. For example this loop

for /f %a in ('%path_to_exe% -a %par1% -b %par2% 2^> %path_to_lof_file% ^| %another.exe% -f %paht_to_out_file% ^| tee %filename%') do something

failed for some reason. Then I had to copy whole command, strip carrets, and put

echo _string_

before loop to fing what is wrong. Thinking about some option to print string with evaluated variables.. Maybe some king of built-in tee function. Only fuzzy ideas, I have no any solution..

@adoxa

This comment has been minimized.

Copy link
Collaborator

@adoxa adoxa commented Nov 4, 2019

echo on usually works for me. Sounds like you want that with an option to keep the variables, e.g. -a %par1%=arg1 -b %par2%=arg2. Tricky, but doable, I think. Possibly expensive, so it'd have to be explicitly enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.