{"action":"opened","issue":{"url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/855","repository_url":"https://api.github.com/repos/phalcon/phalcon-devtools","labels_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/855/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/855/comments","events_url":"https://api.github.com/repos/phalcon/phalcon-devtools/issues/855/events","html_url":"https://github.com/phalcon/phalcon-devtools/issues/855","id":179346744,"number":855,"title":"Poor or missing usage help, inconsistent argument handling","user":{"login":"okdana","id":122095,"avatar_url":"https://avatars.githubusercontent.com/u/122095?v=3","gravatar_id":"","url":"https://api.github.com/users/okdana","html_url":"https://github.com/okdana","followers_url":"https://api.github.com/users/okdana/followers","following_url":"https://api.github.com/users/okdana/following{/other_user}","gists_url":"https://api.github.com/users/okdana/gists{/gist_id}","starred_url":"https://api.github.com/users/okdana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okdana/subscriptions","organizations_url":"https://api.github.com/users/okdana/orgs","repos_url":"https://api.github.com/users/okdana/repos","events_url":"https://api.github.com/users/okdana/events{/privacy}","received_events_url":"https://api.github.com/users/okdana/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-26T21:52:08Z","updated_at":"2016-09-26T21:52:08Z","closed_at":null,"body":"Hey there, just trying out Phalcon for the first time. I installed the Phalcon DevTools since some of the tutorials i found on-line use them.\r\n\r\nUsually the first thing i do when i install a command-line utility is look at the usage help.\r\n\r\n```\r\nproserpina:phalcon-devtools % ./phalcon.phar -h\r\nPhalcon DevTools (3.0.1)\r\n\r\nError: -h is not a recognized command.\r\n\r\nproserpina:phalcon-devtools % ./phalcon.phar --help\r\nPhalcon DevTools (3.0.1)\r\n\r\nError: --help is not a recognized command.\r\n\r\nproserpina:phalcon-devtools % ./phalcon.phar help\r\nPhalcon DevTools (3.0.1)\r\n\r\nError: help is not a recognized command.\r\n```\r\n\r\nOK. None of the usual options work. Let's try running it with no options:\r\n\r\n```\r\nproserpina:phalcon-devtools % ./phalcon.phar\r\nPhalcon DevTools (3.0.1)\r\n\r\nAvailable commands:\r\n  commands         (alias of: list, enumerate)\r\n  controller       (alias of: create-controller)\r\n  module           (alias of: create-module)\r\n  model            (alias of: create-model)\r\n  all-models       (alias of: create-all-models)\r\n  project          (alias of: create-project)\r\n  scaffold         (alias of: create-scaffold)\r\n  migration        (alias of: create-migration)\r\n  webtools         (alias of: create-webtools)\r\n```\r\n\r\nWell, there's the list of commands, but now what? What do the commands do? Maybe they'll take a help option:\r\n\r\n```\r\nproserpina:phalcon-devtools % ./phalcon.phar controller -h\r\nPhalcon DevTools (3.0.1)\r\n\r\nError: This command should be invoked inside a Phalcon project directory.  \r\n\r\nproserpina:phalcon-devtools % ./phalcon.phar controller --help\r\nPhalcon DevTools (3.0.1)\r\n                                                                             \r\nError: This command should be invoked inside a Phalcon project directory.\r\n\r\nproserpina:phalcon-devtools % ./phalcon.phar controller help\r\nPhalcon DevTools (3.0.1)\r\n                                                                             \r\nError: This command should be invoked inside a Phalcon project directory.\r\n```\r\n\r\nMaybe not. It says something about projects though, maybe i should see what's up with the `project` command:\r\n\r\n```\r\nproserpina:phalcon-devtools % ./phalcon.phar project -h\r\nPhalcon DevTools (3.0.1)\r\n                                \r\nError: Unknown parameter 'h'  \r\n\r\nproserpina:phalcon-devtools % ./phalcon.phar project --help\r\nPhalcon DevTools (3.0.1)\r\n\r\nHelp:\r\n  Creates a project\r\n\r\nUsage:\r\n  project [name] [type] [directory] [enable-webtools]\r\n\r\nArguments:\r\n  help\tShows this help text\r\n\r\nExample\r\n  phalcon project store simple\r\n\r\nOptions:\r\n --name               Name of the new project\r\n --enable-webtools    Determines if webtools should be enabled [optional]\r\n --directory=s        Base path on which project will be created [optional]\r\n --type=s             Type of the application to be generated (cli, micro, simple, modules)\r\n --template-path=s    Specify a template path [optional]\r\n --use-config-ini     Use a ini file as configuration file [optional]\r\n --trace              Shows the trace of the framework in case of exception [optional]\r\n --help               Shows this help\r\n```\r\n\r\nThere's something. Some kind of weird confusion/redundancy between arguments/operands and options, but it seems to work at least. Maybe now i can find out what the `controller` command does.\r\n\r\n```\r\nproserpina:phalcon-devtools % cd myproject\r\n\r\nproserpina:myproject % ../phalcon.phar controller -h\r\nPhalcon DevTools (3.0.1)\r\n\r\nError: Unknown parameter 'h'\r\n\r\nproserpina:myproject % ../phalcon.phar controller --help\r\nPhalcon DevTools (3.0.1)\r\n                                   \r\nError: Unknown parameter 'help'\r\n\r\nproserpina:myproject % ../phalcon.phar controller help\r\nPhalcon DevTools (3.0.1)\r\n\r\nHelp:\r\n  Creates a controller\r\n\r\nUsage:\r\n  controller [name] [directory]\r\n\r\nArguments:\r\n  help\tShows this help text\r\n\r\nOptions:\r\n --name=s          Controller name\r\n --namespace=s     Controller's namespace [option]\r\n --directory=s     Base path on which project is located [optional]\r\n --output=s        Directory where the controller should be created [optional]\r\n --base-class=s    Base class to be inherited by the controller [optional]\r\n --force           Force to rewrite controller [optional]\r\n```\r\n\r\nOK, unlike `project`, `controller` only takes `help` i guess. That's strange, because i went back to look at the documentation on phalconphp.com and it tells me to use `--help` whenever i want to get the usage help for a command.\r\n\r\nWhat about some of the other commands?\r\n\r\n```\r\nproserpina:myproject % ../phalcon.phar all-models help\r\nPhalcon DevTools (3.0.1)\r\n\r\nOptions:\r\n --config=s       Configuration file [optional]\r\n --models=s       Models directory [optional]\r\n --schema=s       Name of the schema. [optional]\r\n --namespace=s    Model's namespace [optional]\r\n --extends=s      Models extends [optional]\r\n --force          Force script to rewrite all the models [optional]\r\n --get-set        Attributes will be protected and have setters/getters [optional]\r\n --doc            Helps to improve code completion on IDEs [optional]\r\n --relations      Possible relations defined according to convention [optional]\r\n --fk             Define any virtual foreign keys [optional]\r\n --validations    Define possible domain validation according to conventions\r\n --directory=s    Base path on which project will be created [optional]\r\n --mapcolumn      Get some code for map columns [optional]\r\n --abstract       Abstract Model [optional]\r\n```\r\n\r\nI suppose that one will remain a mystery 🙍"}}
{"actor":{"display_login":"okdana"}}