]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Application/ShellCTestApp/TestArgv.nsh
ShellPkg: Add a simple case to test shell parameter parsing logic
[mirror_edk2.git] / ShellPkg / Application / ShellCTestApp / TestArgv.nsh
CommitLineData
7534ae58
RN
1#/** @file\r
2# This is a very simple shell script to test how the interpreter parses the parameters.\r
3#\r
4# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
5# This program and the accompanying materials\r
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12#\r
13#**/\r
14echo -on\r
15set Var_EFCF356F_228C_47C2_AD0C_3B5DAC9A8CFA ValueOfGuid\r
16set Sharp_E8528E46_A008_4221_8DE0_D5AB42A9C580 ^#\r
17set Quote_E95DEE8B_E3AA_4155_9ED5_6916394104FC ^"\r
18set Var_ShellCTestApp_EE6E8BC6_71A6_44A5_BED3_D8F901105CDE ShellCTestApp_EE6E8BC6_71A6_44A5_BED3_D8F901105CDE\r
19alias ShellCTestApp_EE6E8BC6_71A6_44A5_BED3_D8F901105CDE ShellCTestApp\r
20\r
21#\r
22# '^' should escape all special characters (including space)\r
23# but has no impact to non-special characters\r
24#\r
25ShellCTestApp ^^\r
26ShellCTestApp ^#\r
27ShellCTestApp ^%Var_EFCF356F_228C_47C2_AD0C_3B5DAC9A8CFA%\r
28ShellCTestApp ^"\r
29ShellCTestApp ^ 1\r
30ShellCTestApp ^ \r
31ShellCTestApp ^1\r
32ShellCTestApp ^^^"\r
33ShellCTestApp ^^^\r
34\r
35#\r
36# '#' should be processed before %% replacement, and inside '"'\r
37#\r
38ShellCTestApp #%Var_EFCF356F_228C_47C2_AD0C_3B5DAC9A8CFA%\r
39#ShellCTestApp "#"\r
40ShellCTestApp %Sharp_E8528E46_A008_4221_8DE0_D5AB42A9C580%\r
41\r
42#\r
43# '%' should be processed before grouping parameters\r
44#\r
45ShellCTestApp "%Var_EFCF356F_228C_47C2_AD0C_3B5DAC9A8CFA% 2%Quote_E95DEE8B_E3AA_4155_9ED5_6916394104FC%\r
46\r
47#\r
48# alias should be processed after %% replacement\r
49#\r
50%Var_ShellCTestApp_EE6E8BC6_71A6_44A5_BED3_D8F901105CDE%\r
51\r
52#\r
53# '"' should be stripped, space inside '"' should be kept, \r
54#\r
55ShellCTestApp "p 1"\r
56ShellCTestApp "p"1\r
57ShellCTestApp "p 1"e"x"""\r
58\r
59set -d Var_EFCF356F_228C_47C2_AD0C_3B5DAC9A8CFA\r
60set -d Sharp_E8528E46_A008_4221_8DE0_D5AB42A9C580\r
61set -d Quote_E95DEE8B_E3AA_4155_9ED5_6916394104FC\r
62set -d Var_ShellCTestApp_EE6E8BC6_71A6_44A5_BED3_D8F901105CDE\r
63alias -d ShellCTestApp_EE6E8BC6_71A6_44A5_BED3_D8F901105CDE\r
64echo -off