Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
' Program (myprogram.exe) invoke as follows:
|
||||
' myprogram -c "alpha beta" -h "gamma"
|
||||
|
||||
Print "The program was invoked like this => "; Command(0) + " " + Command(-1)
|
||||
Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
|
|
@ -0,0 +1 @@
|
|||
println( args )
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
PROCEDURE Main()
|
||||
|
||||
LOCAL i
|
||||
|
||||
FOR i := 1 TO PCount()
|
||||
? "argument", hb_ntos( i ), "=", hb_PValue( i )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
|
@ -0,0 +1 @@
|
|||
$ ./bin/lfe -pa ebin/ -c "alpha beta" -h "gamma"
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
> (: init get_arguments)
|
||||
(#(root ("/opt/erlang/r15b03"))
|
||||
#(progname ("erl"))
|
||||
#(home ("/Users/oubiwann"))
|
||||
#(user ("lfe_boot"))
|
||||
#(pa ("ebin/"))
|
||||
#(c ("alpha beta"))
|
||||
#(h ("gamma")))
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
> (: init get_argument 'c)
|
||||
#(ok (("alpha beta")))
|
||||
> (: init get_argument 'h)
|
||||
#(ok (("gamma")))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/lasso9
|
||||
|
||||
iterate($argv) => {
|
||||
stdoutnl("Argument " + loop_count + ": " + loop_value)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
$ lasso9 arguments.lasso -c "alpha beta" -h "gamma"
|
||||
Argument 1: arguments.lasso
|
||||
Argument 2: -c
|
||||
Argument 3: alpha beta
|
||||
Argument 4: -h
|
||||
Argument 5: gamma
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
put the commandline
|
||||
-- "-c alpha beta -h gamma"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
put getCommandLineArgs()
|
||||
-- ["-c", "alpha beta", "-h", "gamma"]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import os
|
||||
let programName = paramStr(0)
|
||||
let arguments = commandLineParams()
|
||||
|
|
@ -0,0 +1 @@
|
|||
System.Args println
|
||||
13
Task/Command-line-arguments/Phix/command-line-arguments.phix
Normal file
13
Task/Command-line-arguments/Phix/command-line-arguments.phix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
constant cmd = command_line()
|
||||
?cmd
|
||||
if cmd[1]=cmd[2] then
|
||||
printf(1,"Compiled executable name: %s\n",{cmd[1]})
|
||||
else
|
||||
printf(1,"Interpreted (using %s) source name: %s\n",cmd[1..2])
|
||||
end if
|
||||
if length(cmd)>2 then
|
||||
puts(1,"Command line arguments:\n")
|
||||
for i = 3 to length(cmd) do
|
||||
printf(1,"#%d : %s\n",{i,cmd[i]})
|
||||
end for
|
||||
end if
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
see copy("=",30) + nl
|
||||
see "Command Line Parameters" + nl
|
||||
see "Size : " + len(sysargv) + nl
|
||||
see sysargv
|
||||
see copy("=",30) + nl
|
||||
for x = 1 to len(sysargv)
|
||||
see x + nl
|
||||
next
|
||||
|
|
@ -0,0 +1 @@
|
|||
say ARGV;
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
let args = Process.arguments
|
||||
println("This program is named \(args[0]).")
|
||||
println("There are \(args.count-1) arguments.")
|
||||
for i in 1..<args.count {
|
||||
println("the argument #\(i) is \(args[i])")
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
println("This program is named \(String.fromCString(Process.unsafeArgv[0])!).")
|
||||
println("There are \(Process.argc-1) arguments.")
|
||||
for i in 1 ..< Int(Process.argc) {
|
||||
println("the argument #\(i) is \(String.fromCString(Process.unsafeArgv[i])!)")
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
println("This program is named \(String.fromCString(C_ARGV[0])!).")
|
||||
println("There are \(C_ARGC-1) arguments.")
|
||||
for i in 1 ..< Int(C_ARGC) {
|
||||
println("the argument #\(i) is \(String.fromCString(C_ARGV[i])!)")
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# command-line arguments
|
||||
#
|
||||
|
||||
# output all arguments
|
||||
for (decl int i) (< i (size args)) (inc i)
|
||||
out args<i> endl console
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue