{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1990","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1990/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1990/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1990/events","html_url":"https://github.com/spring-projects/spring-boot/issues/1990","id":49901343,"number":1990,"title":"Provide an option to filter arguments handled by Boot from those passed to CommandLineRunners","user":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-24T15:26:00Z","updated_at":"2015-06-17T11:26:06Z","closed_at":null,"body":"From [StackOverflow](http://stackoverflow.com/questions/27059936/spring-boot-commandlinerunner-filter-option-argument):\r\n\r\n> Considering a Spring Boot `CommandLineRunner` Application, I would like to know how to filter the \"switch\" options passed to Spring Boot as externalized configuration.\r\n\r\n> For example, with:\r\n\r\n>     @Component\r\n    public class FileProcessingCommandLine implements CommandLineRunner {\r\n        @Override\r\n        public void run(String... strings) throws Exception {\r\n            for (String filename: strings) {\r\n               File file = new File(filename);\r\n               service.doSomething(file);\r\n            }\r\n        }\r\n    }\r\n\r\n> I can call ` java -jar myJar.jar /tmp/file1 /tmp/file2` and the service will be called for both files.\r\n\r\n> But if I add a Spring parameter, like ` java -jar myJar.jar /tmp/file1 /tmp/file2 --spring.config.name=myproject ` then the configuration name is updated (right!) but the service is also called for file `./--spring.config.name=myproject` which of course doesn't exist.\r\n\r\n> I know I can filter manually on the filename with something like\r\n\r\n>     if (!filename.startsWith(\"--\")) ...\r\n\r\n> But as all of this components came from Spring, I wonder if there is not a option somewhere to let it manage it, and to ensure the `strings` parameter passed to the `run` method will not contain at all the properties options already parsed at the Application level."},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/112760408","html_url":"https://github.com/spring-projects/spring-boot/issues/1990#issuecomment-112760408","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/1990","id":112760408,"user":{"login":"MadaraUchiha","id":1188951,"avatar_url":"https://avatars.githubusercontent.com/u/1188951?v=3","gravatar_id":"","url":"https://api.github.com/users/MadaraUchiha","html_url":"https://github.com/MadaraUchiha","followers_url":"https://api.github.com/users/MadaraUchiha/followers","following_url":"https://api.github.com/users/MadaraUchiha/following{/other_user}","gists_url":"https://api.github.com/users/MadaraUchiha/gists{/gist_id}","starred_url":"https://api.github.com/users/MadaraUchiha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadaraUchiha/subscriptions","organizations_url":"https://api.github.com/users/MadaraUchiha/orgs","repos_url":"https://api.github.com/users/MadaraUchiha/repos","events_url":"https://api.github.com/users/MadaraUchiha/events{/privacy}","received_events_url":"https://api.github.com/users/MadaraUchiha/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T11:26:06Z","updated_at":"2015-06-17T11:26:06Z","body":"Bump, can this be considered?"}}