{"action":"created","issue":{"url":"https://api.github.com/repos/r1pper/Topshelf.StartParameters/issues/1","labels_url":"https://api.github.com/repos/r1pper/Topshelf.StartParameters/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/r1pper/Topshelf.StartParameters/issues/1/comments","events_url":"https://api.github.com/repos/r1pper/Topshelf.StartParameters/issues/1/events","html_url":"https://github.com/r1pper/Topshelf.StartParameters/issues/1","id":120775052,"number":1,"title":"Example with multiple parameters","user":{"login":"mph911","id":7911974,"avatar_url":"https://avatars.githubusercontent.com/u/7911974?v=3","gravatar_id":"","url":"https://api.github.com/users/mph911","html_url":"https://github.com/mph911","followers_url":"https://api.github.com/users/mph911/followers","following_url":"https://api.github.com/users/mph911/following{/other_user}","gists_url":"https://api.github.com/users/mph911/gists{/gist_id}","starred_url":"https://api.github.com/users/mph911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mph911/subscriptions","organizations_url":"https://api.github.com/users/mph911/orgs","repos_url":"https://api.github.com/users/mph911/repos","events_url":"https://api.github.com/users/mph911/events{/privacy}","received_events_url":"https://api.github.com/users/mph911/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-07T13:32:43Z","updated_at":"2015-12-07T15:19:35Z","closed_at":"2015-12-07T15:19:35Z","body":"@r1pper: I tried to work with multiple parameters, i.e. \r\n`myservice -i 5 -u \"xyz\"`\r\n\r\ndefined it within the TopShelf constructor\r\n\r\n    x.WithCustomStartParameter (\"pl\", \"name\",\r\n             a =>\r\n             {\r\n                 if (string.IsNullOrWhiteSpace (a))\r\n                     throw new ArgumentException (\"ERROR: ...\");\r\n\r\n                 int plId;\r\n                 string name;\r\n\r\n                 if (int.TryParse (a, out plId))\r\n                     system.ProductionLineId = plId;\r\n                 else\r\n                 {\r\n                     if (!string.IsNullOrWhiteSpace (name))\r\n                         system.UserName = name;\r\n                     else\r\n                         throw new ArgumentException (\"ERROR: ...\");\r\n             }\r\n\r\nBut it seems that I misunderstand the usage. \"pl\" should refer to the first and \"name\" to the second parameter. I also assumed that the lambda is called for each parameter found.\r\n\r\nPlease let me know if that is a correct approach or if there is a better one!\r\n\r\nThank you!\r\n"},"comment":{"url":"https://api.github.com/repos/r1pper/Topshelf.StartParameters/issues/comments/162554868","html_url":"https://github.com/r1pper/Topshelf.StartParameters/issues/1#issuecomment-162554868","issue_url":"https://api.github.com/repos/r1pper/Topshelf.StartParameters/issues/1","id":162554868,"user":{"login":"mph911","id":7911974,"avatar_url":"https://avatars.githubusercontent.com/u/7911974?v=3","gravatar_id":"","url":"https://api.github.com/users/mph911","html_url":"https://github.com/mph911","followers_url":"https://api.github.com/users/mph911/followers","following_url":"https://api.github.com/users/mph911/following{/other_user}","gists_url":"https://api.github.com/users/mph911/gists{/gist_id}","starred_url":"https://api.github.com/users/mph911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mph911/subscriptions","organizations_url":"https://api.github.com/users/mph911/orgs","repos_url":"https://api.github.com/users/mph911/repos","events_url":"https://api.github.com/users/mph911/events{/privacy}","received_events_url":"https://api.github.com/users/mph911/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T15:19:35Z","updated_at":"2015-12-07T15:19:35Z","body":"I completly missed the point that for every parameter a lambda is needed. Thank you very much for your almost instant answer!\r\nMuch appreachiated! :+1: "}}