{"action":"created","issue":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/2868","repository_url":"https://api.github.com/repos/xonsh/xonsh","labels_url":"https://api.github.com/repos/xonsh/xonsh/issues/2868/labels{/name}","comments_url":"https://api.github.com/repos/xonsh/xonsh/issues/2868/comments","events_url":"https://api.github.com/repos/xonsh/xonsh/issues/2868/events","html_url":"https://github.com/xonsh/xonsh/pull/2868","id":367480266,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwOTAxMzU5","number":2868,"title":"created code for doing bash-like brace expansion.","user":{"login":"ninjaaron","id":1073664,"node_id":"MDQ6VXNlcjEwNzM2NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1073664?v=4","gravatar_id":"","url":"https://api.github.com/users/ninjaaron","html_url":"https://github.com/ninjaaron","followers_url":"https://api.github.com/users/ninjaaron/followers","following_url":"https://api.github.com/users/ninjaaron/following{/other_user}","gists_url":"https://api.github.com/users/ninjaaron/gists{/gist_id}","starred_url":"https://api.github.com/users/ninjaaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ninjaaron/subscriptions","organizations_url":"https://api.github.com/users/ninjaaron/orgs","repos_url":"https://api.github.com/users/ninjaaron/repos","events_url":"https://api.github.com/users/ninjaaron/events{/privacy}","received_events_url":"https://api.github.com/users/ninjaaron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-10-06T17:53:48Z","updated_at":"2018-10-13T10:45:55Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/xonsh/xonsh/pulls/2868","html_url":"https://github.com/xonsh/xonsh/pull/2868","diff_url":"https://github.com/xonsh/xonsh/pull/2868.diff","patch_url":"https://github.com/xonsh/xonsh/pull/2868.patch"},"body":"Hi. The thing that bothers me the most in xonsh is the lack of Bash-like brace expansion. I have a lot of files with yy.mm.dd format dates in the title, and brace expansion is very useful for selecting certain date ranges and file types, moreso than regex. consider the following\r\n\r\n```bash\r\n$ touch 18.10.{01..30}\r\n$ ls 18.10.{05..23}\r\n18.10.05  18.10.08  18.10.11  18.10.14  18.10.17  18.10.20  18.10.23\r\n18.10.06  18.10.09  18.10.12  18.10.15  18.10.18  18.10.21\r\n18.10.07  18.10.10  18.10.13  18.10.16  18.10.19  18.10.22\r\n```\r\nAs far as I am aware, doing something like this is non-trivial in xonsh.\r\n\r\nThis patch provides only a module with a function which can expand strings in this way. I have not made an attempt to merge this into current globbing system, which I believe is a task the maintainers will have a better handle on anyway.\r\n\r\nPlease let me know if this PR needs additional work before it is usable."},"comment":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/comments/429532014","html_url":"https://github.com/xonsh/xonsh/pull/2868#issuecomment-429532014","issue_url":"https://api.github.com/repos/xonsh/xonsh/issues/2868","id":429532014,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTUzMjAxNA==","user":{"login":"ninjaaron","id":1073664,"node_id":"MDQ6VXNlcjEwNzM2NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1073664?v=4","gravatar_id":"","url":"https://api.github.com/users/ninjaaron","html_url":"https://github.com/ninjaaron","followers_url":"https://api.github.com/users/ninjaaron/followers","following_url":"https://api.github.com/users/ninjaaron/following{/other_user}","gists_url":"https://api.github.com/users/ninjaaron/gists{/gist_id}","starred_url":"https://api.github.com/users/ninjaaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ninjaaron/subscriptions","organizations_url":"https://api.github.com/users/ninjaaron/orgs","repos_url":"https://api.github.com/users/ninjaaron/repos","events_url":"https://api.github.com/users/ninjaaron/events{/privacy}","received_events_url":"https://api.github.com/users/ninjaaron/received_events","type":"User","site_admin":false},"created_at":"2018-10-13T10:45:55Z","updated_at":"2018-10-13T10:45:55Z","author_association":"NONE","body":"I've spent a little time on it this morning. I figured out how to integrate expansion into glob strings (the non-regex ones), but I have a couple questions regarding interface.\r\n\r\n1. Glob strings don't return anything if there was no matching filename. In Bash, brace expansion can be used without globbing to create the products of arbitrary strings. Is this something we'd like to expose in xonsh, or is matching only existing filenames enough? (the addition of something like an e-string might be required to facilitate this, though I haven't yet found where syntax for these special strings are implemented. I'm afraid to look at the parser!)\r\n2. At present, having braces in unquoted subprocess-mode arguments makes the parser angry. Once again, I fear the parser and don't even know where to begin looking to change this. I believe I do see where to add brace expansion for unquoted subprocess-mode arguments, but they won't get though the parser anyway. Thoughts?"}}
{"actor":{"display_login":"ninjaaron"}}