{"action":"opened","issue":{"url":"https://api.github.com/repos/dthree/vorpal/issues/17","labels_url":"https://api.github.com/repos/dthree/vorpal/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/dthree/vorpal/issues/17/comments","events_url":"https://api.github.com/repos/dthree/vorpal/issues/17/events","html_url":"https://github.com/dthree/vorpal/issues/17","id":110808318,"number":17,"title":"Command remove does not work (_parent.commands is not accessible)","user":{"login":"melonmanchan","id":6872462,"avatar_url":"https://avatars.githubusercontent.com/u/6872462?v=3","gravatar_id":"","url":"https://api.github.com/users/melonmanchan","html_url":"https://github.com/melonmanchan","followers_url":"https://api.github.com/users/melonmanchan/followers","following_url":"https://api.github.com/users/melonmanchan/following{/other_user}","gists_url":"https://api.github.com/users/melonmanchan/gists{/gist_id}","starred_url":"https://api.github.com/users/melonmanchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melonmanchan/subscriptions","organizations_url":"https://api.github.com/users/melonmanchan/orgs","repos_url":"https://api.github.com/users/melonmanchan/repos","events_url":"https://api.github.com/users/melonmanchan/events{/privacy}","received_events_url":"https://api.github.com/users/melonmanchan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-10T18:03:15Z","updated_at":"2015-10-10T18:03:15Z","closed_at":null,"body":"It seems as if the _parent attribute of a command is not passed on properly upon initialization? Is it enough to simply pass the exports-object to the newly created command?\r\n\r\n```javascript\r\nconsole.log(this._parent) => [Function: Vorpal]\r\n\r\n\r\nconsole.log(this._parent.toString()) => function Vorpal() {\r\n if (!(this instanceof Vorpal)) {\r\n   return new Vorpal();\r\n }  // Program version\r\n // Exposed through vorpal.version(str);\r\n this._version = '';  // Registered vorpal.command commands and\r\n // their options.\r\n this.commands = [];  // Queue of IP requests, executed async, in sync.\r\n this._queue = [];  // Current command being executed.\r\n this._command = undefined;  // Expose UI.\r\n this.ui = ui;  // Expose chalk as a convenience.\r\n this.chalk = chalk;  // Expose lodash as a convenience.\r\n this.lodash = _;  // Exposed through vorpal.delimiter(str).\r\n this._delimiter = 'local@' + String(os.hostname()).split('.')[0] + '~$ ';\r\n ui.setDelimiter(this._delimiter);  // Placeholder for vantage server. If vantage\r\n // is used, this will be over-written.\r\n this.server = {\r\n   sessions: []\r\n };  // Whether all stdout is being hooked through a function.\r\n this._hooked = false;  // Expose common utilities, like padding.\r\n this.util = VorpalUtil;  this.Session = Session;  // Active vorpal server session.\r\n this.session = new this.Session({\r\n   local: true,\r\n   user: 'local',\r\n   parent: this,\r\n   delimiter: this._delimiter\r\n });  this._init();\r\n return this;\r\n}\r\n\r\n```\r\n\r\nShould intended behavior when initializing the command be something like:\r\n\r\n```javascript\r\nvar cmd = new Command(cmdName, this)\r\n```\r\n instead of:\r\n```javascript\r\nvar cmd = new Command(cmdName, exports);\r\n```\r\n\r\nThis would allow the parent object attributes to be properly accessible to the Command-object. Ran into this kink while attempting to implement duplicate alias detection."}}