Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 3aba363

Browse files
author
Joe Bickley
authored
Merge pull request #6 from mountaindude/master
Fixed incorrect long param for virtual proxy
2 parents e80856a + 9688215 commit 3aba363

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

CacheInitializer/ParamHandler.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ class Options
1717
public string server { get; set; }
1818

1919
[Option('a', "appname", Required = false,
20-
HelpText = "App to load")]
20+
HelpText = "App to load (using app name)")]
2121
public string appname { get; set; }
2222

23-
[Option('p', "appname", Required = false,
23+
[Option('i', "appid", Required = false,
24+
HelpText = "App to load (using app ID)")]
25+
public string appid { get; set; }
26+
27+
[Option('p', "proxy", Required = false,
2428
HelpText = "Virtual Proxy to use")]
2529
public string virtualProxy { get; set; }
2630

CacheInitializer/Program.cs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static void Main(string[] args)
4343
{
4444
serverURL = new Uri(options.server);
4545
appname = options.appname;
46+
appid = options.appid;
4647
virtualProxy = !string.IsNullOrEmpty(options.virtualProxy) ? options.virtualProxy : "" ;
4748
openSheets = options.fetchobjects;
4849
if (options.selectionfield != null)
@@ -73,19 +74,32 @@ static void Main(string[] args)
7374

7475

7576
////Start to cache the apps
76-
if (appname != null)
77+
78+
if (appid != null)
7779
{
78-
//Open up and cache one app
79-
IAppIdentifier appidentifier = remoteQlikSenseLocation.AppWithNameOrDefault(appname);
80+
//Open up and cache one app, based on app ID
81+
IAppIdentifier appidentifier = remoteQlikSenseLocation.AppWithId(appid);
8082

8183
LoadCache(remoteQlikSenseLocation, appidentifier, openSheets, mySelection);
84+
8285
}
8386
else
8487
{
85-
//Get all apps, open them up and cache them
86-
remoteQlikSenseLocation.GetAppIdentifiers().ToList().ForEach(id => LoadCache(remoteQlikSenseLocation, id, openSheets, null));
88+
if (appname != null)
89+
{
90+
//Open up and cache one app
91+
IAppIdentifier appidentifier = remoteQlikSenseLocation.AppWithNameOrDefault(appname);
92+
93+
LoadCache(remoteQlikSenseLocation, appidentifier, openSheets, mySelection);
94+
}
95+
else
96+
{
97+
//Get all apps, open them up and cache them
98+
remoteQlikSenseLocation.GetAppIdentifiers().ToList().ForEach(id => LoadCache(remoteQlikSenseLocation, id, openSheets, null));
99+
}
87100
}
88101

102+
89103
////Wrap it up
90104
var dt = DateTime.Now - d;
91105
Print("Cache initialization complete. Total time: {0}", dt.ToString());

0 commit comments

Comments
 (0)