{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/CliCommandLineParser/issues/103","repository_url":"https://api.github.com/repos/dotnet/CliCommandLineParser","labels_url":"https://api.github.com/repos/dotnet/CliCommandLineParser/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/CliCommandLineParser/issues/103/comments","events_url":"https://api.github.com/repos/dotnet/CliCommandLineParser/issues/103/events","html_url":"https://github.com/dotnet/CliCommandLineParser/issues/103","id":318751981,"number":103,"title":"Give more information to suggestion function","user":{"login":"svick","id":287848,"avatar_url":"https://avatars3.githubusercontent.com/u/287848?v=4","gravatar_id":"","url":"https://api.github.com/users/svick","html_url":"https://github.com/svick","followers_url":"https://api.github.com/users/svick/followers","following_url":"https://api.github.com/users/svick/following{/other_user}","gists_url":"https://api.github.com/users/svick/gists{/gist_id}","starred_url":"https://api.github.com/users/svick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svick/subscriptions","organizations_url":"https://api.github.com/users/svick/orgs","repos_url":"https://api.github.com/users/svick/repos","events_url":"https://api.github.com/users/svick/events{/privacy}","received_events_url":"https://api.github.com/users/svick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-29T21:33:38Z","updated_at":"2018-04-30T16:30:19Z","closed_at":null,"author_association":"NONE","body":"As far as I can tell, when specifying `ArgumentsRule` for an argument, the options for specifying suggestions are:\r\n\r\n* static list: `public static ArgumentsRule WithSuggestionsFrom(this ArgumentsRule rule, params string[] values)`\r\n* dynamic list based on the current value of the argument: `public static ArgumentsRule WithSuggestionsFrom(this ArgumentsRule rule, Func<string, IEnumerable<string>> suggest)`\r\n\r\nBut for https://github.com/dotnet/cli/issues/9172, I would like for the suggestion function to know not just the value of the argument being suggested, but also values of other arguments. That way, e.g. `dotnet add package Microsoft.CodeAnalysis -v <Tab>` could get the name of the package (`Microsoft.CodeAnalysis`) to query an API for a list of its versions.\r\n\r\nThe necessary information seems to be already contained in the `ParseResult` that's passed to `ArgumentsRule.Suggest()`, but there doesn't seem to be a way to access that from the suggestion function.\r\n\r\nOr am I missing something and there is already a way to do this?"},"comment":{"url":"https://api.github.com/repos/dotnet/CliCommandLineParser/issues/comments/385452934","html_url":"https://github.com/dotnet/CliCommandLineParser/issues/103#issuecomment-385452934","issue_url":"https://api.github.com/repos/dotnet/CliCommandLineParser/issues/103","id":385452934,"user":{"login":"svick","id":287848,"avatar_url":"https://avatars3.githubusercontent.com/u/287848?v=4","gravatar_id":"","url":"https://api.github.com/users/svick","html_url":"https://github.com/svick","followers_url":"https://api.github.com/users/svick/followers","following_url":"https://api.github.com/users/svick/following{/other_user}","gists_url":"https://api.github.com/users/svick/gists{/gist_id}","starred_url":"https://api.github.com/users/svick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svick/subscriptions","organizations_url":"https://api.github.com/users/svick/orgs","repos_url":"https://api.github.com/users/svick/repos","events_url":"https://api.github.com/users/svick/events{/privacy}","received_events_url":"https://api.github.com/users/svick/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T16:30:19Z","updated_at":"2018-04-30T16:30:19Z","author_association":"NONE","body":"@KathleenDollard \r\n\r\n> Are you looking at this just in the context of #9172, or are you also using the parser for other purposes (via fork, copy, etc.)?\r\n\r\nI'm not using the parser myself, I'm asking just for https://github.com/dotnet/cli/issues/9172. This was the most reasonable way I could think of of implementing that."}}
{"actor":{"display_login":"svick"}}