Of course, you were right about the extension..works as .cobra. Follow up:
===================================================================================
1. With the .cobra extension, it prints the output 3 times. (Actually, with the .txt extension, it fails 3 times, too)
D:\CobraProjects\HelloWorld>cobra HelloWorld.cobra
hello, world.
hello, world.
hello, world.
===================================================================================
2. Here is debug output using .cobra (to explain the triple output?):
D:\CobraProjects\HelloWorld>cobra -v:2 -d HelloWorld.cobra
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.cobra
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.cobra
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.exe"
/nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\Cobr
aLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.cobra.cs"
Deleting intermediate files.
Running: HelloWorld
-------------------------------------------------------------------------------
hello, world.
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.cobra
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.cobra
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.exe"
/nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\Cobr
aLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.cobra.cs"
Deleting intermediate files.
Running: HelloWorld
-------------------------------------------------------------------------------
hello, world.
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
editor: 'uedit32_FILE/LINE'
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.cobra
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.cobra
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.exe"
/nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\Cobr
aLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.cobra.cs"
Deleting intermediate files.
Running: HelloWorld
-------------------------------------------------------------------------------
hello, world.
D:\CobraProjects\HelloWorld>
===================================================================================
3. Here's the debug output for the .txt error (just because you asked
D:\CobraProjects\HelloWorld>cobra -v:2 -d HelloWorld.txt
cobra: error: Cannot find "HelloWor;d.txt" as a file.
Run Cobra without options to get full usage information.
cobra: error: Cannot find "HelloWor;d.txt" as a file.
Run Cobra without options to get full usage information.
cobra: error: Cannot find "HelloWor;d.txt" as a file.
Run Cobra without options to get full usage information.
D:\CobraProjects\HelloWorld>cobra -v:2 -d HelloWorld.txt
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.txt
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.txt
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.txt.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.txt.
exe" /nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\
CobraLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.txt.cs"
Deleting intermediate files.
Running: HelloWorld.txt
-------------------------------------------------------------------------------
An unhandled exception has occurred.
Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra
Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.txt
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.txt
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.txt.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.txt.
exe" /nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\
CobraLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.txt.cs"
Deleting intermediate files.
Running: HelloWorld.txt
-------------------------------------------------------------------------------
An unhandled exception has occurred.
Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra
Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
Cobra Command Line 0.7.3
current directory: D:\CobraProjects\HelloWorld
current exe: C:\Cobra\Cobra-0.7.3\bin\cobra.exe
option dictionary:
color: true
editor: 'uedit32_FILE/LINE'
verbosity: 2
debug: '+'
contracts: 'inline'
debugging-tips: true
embed-run-time: true
include-tests: true
paths:
HelloWorld.txt
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b7
7a5c561934e089 at C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a
5c561934e089 at C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\Sy
stem.dll
Noting C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs
Parsing C:\Cobra\Cobra-0.7.3\bin\SystemInterfaces.cobra
Parsing C:\Cobra\Cobra-0.7.3\bin\CobraLang.cobra
Noting C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs
Parsing HelloWorld.txt
Binding use directives
Binding inheritance
Binding interface
Binding implementation
Compiling generated code
Compiling to produce HelloWorld.txt.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /debug+ "/out:HelloWorld.txt.
exe" /nologo "C:\Cobra\Cobra-0.7.3\bin\CobraInfo.cs" "C:\Cobra\Cobra-0.7.3\bin\
CobraLang.cobra.cs" "C:\Cobra\Cobra-0.7.3\bin\CobraLang.cs" "HelloWorld.txt.cs"
Deleting intermediate files.
Running: HelloWorld.txt
-------------------------------------------------------------------------------
An unhandled exception has occurred.
Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra
Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()