File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ public static void Main(string[] args)
5858 case "runscript" :
5959 RunScript ( commandArgs ) ;
6060 break ;
61+
62+ case "viewscript" :
63+ ViewScript ( commandArgs ) ;
64+ break ;
65+
6166 default :
6267 Error . WriteLine ( $ "Unknown command { commandName } ") ;
6368 break ;
@@ -76,10 +81,19 @@ public static void RunScript(string[] commandArgs)
7681 var scriptfile = commandArgs [ 0 ] ;
7782
7883 var responseCreator = new FileDynamicResponseCreator ( scriptfile ) ;
79- var body = responseCreator . GetBody ( new RequestInfo { EndpointDirectory = Path . GetDirectoryName ( scriptfile ) } ) ;
84+ var body = responseCreator . GetBody ( new RequestInfo {
85+ RequestBody = commandArgs . Length == 2 ? File . ReadAllText ( commandArgs [ 1 ] ) : "" ,
86+ EndpointDirectory = Path . GetDirectoryName ( scriptfile )
87+ } ) ;
8088 Console . WriteLine ( body ) ;
8189 }
8290
91+ public static void ViewScript ( string [ ] commandArgs )
92+ {
93+ var scriptfile = commandArgs [ 0 ] ;
94+ Console . WriteLine ( DynamicResponseCreatorBase . ExecuteIncludes ( File . ReadAllText ( scriptfile ) , Path . GetDirectoryName ( scriptfile ) ) ) ;
95+ }
96+
8397 public static void Match ( string [ ] args )
8498 {
8599 var path = args [ 0 ] ;
You can’t perform that action at this time.
0 commit comments