| 1 |
#%Module1.0 |
| 2 |
|
| 3 |
############################################################################## |
| 4 |
# Modules Revision 3.0 |
| 5 |
# Providing a flexible user environment |
| 6 |
# |
| 7 |
# File: function/%M% |
| 8 |
# Revision: %I% |
| 9 |
# First Edition: 2018/10/14 |
| 10 |
# Last Mod.: %U%, %G% |
| 11 |
# |
| 12 |
# Authors: nanobowers <[email protected]> |
| 13 |
# |
| 14 |
# Description: Testsuite modulefile |
| 15 |
# Command: |
| 16 |
# Sub-Command: set-function |
| 17 |
# |
| 18 |
# Comment: %C{ |
| 19 |
# Check how some function argument variables are translated |
| 20 |
# }C% |
| 21 |
# |
| 22 |
############################################################################## |
| 23 |
|
| 24 |
if {[module-info shelltype] == "fish" } then { |
| 25 |
set-function testsuite {eval (echo cd $argv[1])} |
| 26 |
} elseif {[module-info shelltype] == "pwsh" } then { |
| 27 |
set-function testsuite { |
| 28 |
Param([Parameter(Mandatory=$true, Position=0)] [string] $arg1); Invoke-Expression (echo cd $arg1) |
| 29 |
} |
| 30 |
} else { |
| 31 |
set-function testsuite {eval $(echo cd $1)} |
| 32 |
} |
| 33 |
|
| 34 |
# test other writing styles |
| 35 |
if {[module-info shelltype] == "fish" } then { |
| 36 |
set-function testsuite2 { |
| 37 |
echo $argv[1] |
| 38 |
} |
| 39 |
set-function testsuite3 { |
| 40 |
echo $argv[1]; |
| 41 |
} |
| 42 |
set-function testsuite4 {echo $argv[1];} |
| 43 |
set-function testsuite5 { |
| 44 |
echo $argv[1] |
| 45 |
echo $argv[2] |
| 46 |
; } |
| 47 |
} elseif {[module-info shelltype] == "pwsh" } then { |
| 48 |
set-function testsuite2 { |
| 49 |
Param([Parameter(Mandatory=$true, Position=0)] [string] $arg1); echo $arg1 |
| 50 |
} |
| 51 |
set-function testsuite3 { |
| 52 |
Param([Parameter(Mandatory=$true, Position=0)] [string] $arg1); echo $arg1; |
| 53 |
} |
| 54 |
set-function testsuite4 {Param([Parameter(Mandatory=$true, Position=0)] [string] $arg1); echo $arg1;} |
| 55 |
set-function testsuite5 { |
| 56 |
Param( |
| 57 |
[Parameter(Mandatory=$true, Position=0)] [string] $arg1, |
| 58 |
[Parameter(Mandatory=$true, Position=1)] [string] $arg2 |
| 59 |
) |
| 60 |
echo $arg1 |
| 61 |
echo $arg2 |
| 62 |
; } |
| 63 |
} else { |
| 64 |
set-function testsuite2 { |
| 65 |
echo $1 |
| 66 |
} |
| 67 |
set-function testsuite3 { |
| 68 |
echo $1; |
| 69 |
} |
| 70 |
set-function testsuite4 {echo $1;} |
| 71 |
set-function testsuite5 { |
| 72 |
echo $1 |
| 73 |
echo $2 |
| 74 |
; } |
| 75 |
} |
| 76 |
|