{"action":"created","issue":{"url":"https://api.github.com/repos/yargs/yargs/issues/1100","repository_url":"https://api.github.com/repos/yargs/yargs","labels_url":"https://api.github.com/repos/yargs/yargs/issues/1100/labels{/name}","comments_url":"https://api.github.com/repos/yargs/yargs/issues/1100/comments","events_url":"https://api.github.com/repos/yargs/yargs/issues/1100/events","html_url":"https://github.com/yargs/yargs/issues/1100","id":310128547,"number":1100,"title":"positional argument order is not respected","user":{"login":"ahmadnassri","id":183195,"avatar_url":"https://avatars2.githubusercontent.com/u/183195?v=4","gravatar_id":"","url":"https://api.github.com/users/ahmadnassri","html_url":"https://github.com/ahmadnassri","followers_url":"https://api.github.com/users/ahmadnassri/followers","following_url":"https://api.github.com/users/ahmadnassri/following{/other_user}","gists_url":"https://api.github.com/users/ahmadnassri/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmadnassri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmadnassri/subscriptions","organizations_url":"https://api.github.com/users/ahmadnassri/orgs","repos_url":"https://api.github.com/users/ahmadnassri/repos","events_url":"https://api.github.com/users/ahmadnassri/events{/privacy}","received_events_url":"https://api.github.com/users/ahmadnassri/received_events","type":"User","site_admin":false},"labels":[{"id":64735224,"url":"https://api.github.com/repos/yargs/yargs/labels/question","name":"question","color":"cc317c","default":true},{"id":668899640,"url":"https://api.github.com/repos/yargs/yargs/labels/triaged","name":"triaged","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-30T17:55:37Z","updated_at":"2018-04-01T01:43:57Z","closed_at":null,"author_association":"NONE","body":"seems like positional argument order is not respected, or at least processed in reverse ...\r\n\r\n```js\r\n#!/usr/bin/env node\r\n\r\nconst yargs = require('yargs')\r\n\r\nfunction command (yargs) {\r\n  yargs\r\n    .positional('first', {\r\n      describe: 'first pos'\r\n    })\r\n    .positional('second', {\r\n      describe: 'second pos'\r\n    })\r\n    .positional('third', {\r\n      describe: 'third pos'\r\n    })\r\n}\r\n\r\nfunction builder (argv) {\r\n  console.log('should be first:', argv.first)\r\n  console.log('should be second:', argv.second)\r\n  console.log('should be third:', argv.third)\r\n}\r\n\r\nyargs.command('$0 [first] <second> <third>', '', command, builder).argv\r\n```\r\n\r\n```bash\r\n$ ./lib/cli.js first second third\r\nshould be first: third\r\nshould be second: first\r\nshould be third: second\r\n```"},"comment":{"url":"https://api.github.com/repos/yargs/yargs/issues/comments/377736440","html_url":"https://github.com/yargs/yargs/issues/1100#issuecomment-377736440","issue_url":"https://api.github.com/repos/yargs/yargs/issues/1100","id":377736440,"user":{"login":"ahmadnassri","id":183195,"avatar_url":"https://avatars2.githubusercontent.com/u/183195?v=4","gravatar_id":"","url":"https://api.github.com/users/ahmadnassri","html_url":"https://github.com/ahmadnassri","followers_url":"https://api.github.com/users/ahmadnassri/followers","following_url":"https://api.github.com/users/ahmadnassri/following{/other_user}","gists_url":"https://api.github.com/users/ahmadnassri/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmadnassri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmadnassri/subscriptions","organizations_url":"https://api.github.com/users/ahmadnassri/orgs","repos_url":"https://api.github.com/users/ahmadnassri/repos","events_url":"https://api.github.com/users/ahmadnassri/events{/privacy}","received_events_url":"https://api.github.com/users/ahmadnassri/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T01:43:57Z","updated_at":"2018-04-01T01:43:57Z","author_association":"NONE","body":"ah, indeed, that seems odd that I ended up with an optional argument as the first one ... I certainly see this no longer as an error, but rather an edge case worthy perhaps (as you suggested) of raising a warning. I'm going to update the issue title accordingly! :+1: "}}
{"actor":{"display_login":"ahmadnassri"}}