{"action":"created","issue":{"url":"https://api.github.com/repos/man-n/man-n/issues/21","labels_url":"https://api.github.com/repos/man-n/man-n/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/man-n/man-n/issues/21/comments","events_url":"https://api.github.com/repos/man-n/man-n/issues/21/events","html_url":"https://github.com/man-n/man-n/pull/21","id":93154736,"number":21,"title":"link: allow direct aliasing","user":{"login":"yoshuawuyts","id":2467194,"avatar_url":"https://avatars.githubusercontent.com/u/2467194?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshuawuyts","html_url":"https://github.com/yoshuawuyts","followers_url":"https://api.github.com/users/yoshuawuyts/followers","following_url":"https://api.github.com/users/yoshuawuyts/following{/other_user}","gists_url":"https://api.github.com/users/yoshuawuyts/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshuawuyts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshuawuyts/subscriptions","organizations_url":"https://api.github.com/users/yoshuawuyts/orgs","repos_url":"https://api.github.com/users/yoshuawuyts/repos","events_url":"https://api.github.com/users/yoshuawuyts/events{/privacy}","received_events_url":"https://api.github.com/users/yoshuawuyts/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-05T23:01:44Z","updated_at":"2015-07-06T09:40:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/man-n/man-n/pulls/21","html_url":"https://github.com/man-n/man-n/pull/21","diff_url":"https://github.com/man-n/man-n/pull/21.diff","patch_url":"https://github.com/man-n/man-n/pull/21.patch"},"body":"Further iteration of #20.\r\n\r\nThis allows for direct aliasing of `man-n --link`, removing the extra overhead of running `eval` every time a new shell is started. It also exposes a familiar interface to new users by using `alias`. It does add some recursion in the code, but I think it's transparent what's going on as long as users are familiar with `shift(1)`.\r\n\r\nThis also moves all CLI flags to the `case` statement, making the user interface more transparent and eliminating the need for the undocumented `--linked` flag.\r\n\r\nThe newly introduced `switch` routine can be replaced with something smarter in the future, possibly allowing to check local deps / remove the need to use `n` in commands. This patch introduces a location to start that work.\r\n\r\nThanks!\r\n\r\n## Changes\r\n- __link__: `man-n --link` can now directly be aliased\r\n- __link__: add `-l` as shorthand\r\n- __docs__: update alias example in readme\r\n- __help__: update `--link` usage examples\r\n- __link__: fall back to npm search if `man(1)` yields no results"},"comment":{"url":"https://api.github.com/repos/man-n/man-n/issues/comments/118787553","html_url":"https://github.com/man-n/man-n/pull/21#issuecomment-118787553","issue_url":"https://api.github.com/repos/man-n/man-n/issues/21","id":118787553,"user":{"login":"wooorm","id":944406,"avatar_url":"https://avatars.githubusercontent.com/u/944406?v=3","gravatar_id":"","url":"https://api.github.com/users/wooorm","html_url":"https://github.com/wooorm","followers_url":"https://api.github.com/users/wooorm/followers","following_url":"https://api.github.com/users/wooorm/following{/other_user}","gists_url":"https://api.github.com/users/wooorm/gists{/gist_id}","starred_url":"https://api.github.com/users/wooorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooorm/subscriptions","organizations_url":"https://api.github.com/users/wooorm/orgs","repos_url":"https://api.github.com/users/wooorm/repos","events_url":"https://api.github.com/users/wooorm/events{/privacy}","received_events_url":"https://api.github.com/users/wooorm/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T09:40:11Z","updated_at":"2015-07-06T09:40:11Z","body":"Sure, I’ll be able to merge and patch later today! Enjoy the continent change 😉"}}