{"action":"created","issue":{"url":"https://api.github.com/repos/resin-io/resin-cli/issues/63","labels_url":"https://api.github.com/repos/resin-io/resin-cli/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/resin-io/resin-cli/issues/63/comments","events_url":"https://api.github.com/repos/resin-io/resin-cli/issues/63/events","html_url":"https://github.com/resin-io/resin-cli/issues/63","id":84613154,"number":63,"title":"The -y flag needs to be at the end of the command which is unusal","user":{"login":"lorenzo-stoakes","id":305511,"avatar_url":"https://avatars.githubusercontent.com/u/305511?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo-stoakes","html_url":"https://github.com/lorenzo-stoakes","followers_url":"https://api.github.com/users/lorenzo-stoakes/followers","following_url":"https://api.github.com/users/lorenzo-stoakes/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo-stoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo-stoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo-stoakes/subscriptions","organizations_url":"https://api.github.com/users/lorenzo-stoakes/orgs","repos_url":"https://api.github.com/users/lorenzo-stoakes/repos","events_url":"https://api.github.com/users/lorenzo-stoakes/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo-stoakes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-03T15:09:05Z","updated_at":"2015-06-04T16:23:41Z","closed_at":null,"body":"It seems that the flag has to be put last in the command, which is very unusual:-\r\n\r\n```\r\n[~]$ resin -y app rm foo                                                                \r\nUsage: resin [COMMAND] [OPTIONS]\r\n\r\nCommands:\r\n\r\n    version                       \toutput the version number\r\n    help [command...]             \tshow help\r\n    login [token]                 \tlogin to resin.io\r\n    logout                        \tlogout from resin.io\r\n    signup                        \tsignup to resin.io\r\n    whoami                        \tget current username\r\n    app create <name>             \tcreate an application\r\n    apps                          \tlist all applications\r\n    app <name>                    \tlist a single application\r\n    app rm <name>                 \tremove an application\r\n    app restart <name>            \trestart an application\r\n    app associate <name>          \tassociate a resin project\r\n    init                          \tinit an application\r\n    devices                       \tlist all devices\r\n    devices supported             \tlist all supported devices\r\n    device rename <name> [newName]\trename a resin device\r\n    device init [device]          \tinitialise a device with resin os\r\n    device <name>                 \tlist a single device\r\n    device rm <name>              \tremove a device\r\n    device identify <uuid>        \tidentify a device with a UUID\r\n    device await <name>           \tawait for a device to become online\r\n    drives                        \tlist available drives\r\n    note <|note>                  \tset a device note\r\n    preferences                   \topen preferences form\r\n    keys                          \tlist all ssh keys\r\n    key add <name> [path]         \tadd a SSH key to resin.io\r\n    key <id>                      \tlist a single ssh key\r\n    key rm <id>                   \tremove a ssh key\r\n    envs                          \tlist all environment variables\r\n    env add <key> [value]         \tadd an environment variable\r\n    env rename <id> <value>       \trename an environment variable\r\n    env rm <id>                   \tremove an environment variable\r\n    logs <uuid>                   \tshow device logs\r\n    os download <name>            \tdownload device OS\r\n    os install <image> [device]   \twrite an operating system image to a device\r\n    examples                      \tlist all example applications\r\n    example clone <id>            \tclone an example application\r\n    example <id>                  \tlist a single example application\r\n    plugins                       \tlist all plugins\r\n    plugin install <name>         \tinstall a plugin\r\n    plugin update <name>          \tupdate a plugin\r\n    plugin rm <name>              \tremove a plugin\r\n    update                        \tupdate the resin cli\r\n\r\nGlobal Options:\r\n\r\n    --quiet, -q         \tquiet (no output)\r\n    --project, -j <path>\tproject path\r\n    --version, -v       \toutput the version number\r\n    --no-color          \tdisable colour highlighting\r\n\r\n[~]$ resin app -y rm foo                                                                \r\nID: 123456789\r\nAPP NAME: foo\r\nDEVICE TYPE: raspberry-pi2\r\nGIT REPOSITORY: <redacted>\r\nCOMMIT: <redacted>\r\n[~]$ resin app rm -y foo\r\nApplication not found: rm\r\n[~]$ resin app rm foo -y\r\n[~]$ # Succeeded.\r\n```\r\n\r\nI'd expect that any of the first 3 possibilities would work, and the final one would fail :)"},"comment":{"url":"https://api.github.com/repos/resin-io/resin-cli/issues/comments/108956520","html_url":"https://github.com/resin-io/resin-cli/issues/63#issuecomment-108956520","issue_url":"https://api.github.com/repos/resin-io/resin-cli/issues/63","id":108956520,"user":{"login":"jviotti","id":2192773,"avatar_url":"https://avatars.githubusercontent.com/u/2192773?v=3","gravatar_id":"","url":"https://api.github.com/users/jviotti","html_url":"https://github.com/jviotti","followers_url":"https://api.github.com/users/jviotti/followers","following_url":"https://api.github.com/users/jviotti/following{/other_user}","gists_url":"https://api.github.com/users/jviotti/gists{/gist_id}","starred_url":"https://api.github.com/users/jviotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jviotti/subscriptions","organizations_url":"https://api.github.com/users/jviotti/orgs","repos_url":"https://api.github.com/users/jviotti/repos","events_url":"https://api.github.com/users/jviotti/events{/privacy}","received_events_url":"https://api.github.com/users/jviotti/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T16:23:41Z","updated_at":"2015-06-04T16:23:41Z","body":"I agree with your concerns, however the minority of the command line tools handle options in the form of `--option=value`.\r\n\r\nI've been checking some other CLIs and they seems to solve the problem by not letting a command have more than one word, e.g: `resin app-rm` instead of `resin app rm`. That'd allow us to assume `argv[1]` is always the command name. In case we implement this change, I'd like the separator to be `-`, in order to be consistent with 'git' and many other well known tools.\r\n\r\nThe problem with this approach is that Capitano promotes this feature and a lot of work has been made to support this kind of multiple-word commands (it's one of they key points of Capitano), but I guess this not really critical since not many applications rely on Capitano."}}