Task #42452
Task #51183: CLI improvements
Command handling should support global flags
Status: | Closed | Start date: | 2012-10-28 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 0% |
|
Category: | Cli | |||
Target version: | - | |||
Sprint: | Has patch: | No | ||
PHP Version: | Complexity: |
Description
The current help handling in Flow is not intuitive. It would be much easier if every command would understand a "--help" switch that would trigger the help for that command. Also the main "flow" script should understand "--help" in addition to "help" like most known commands on the cli do.
Related issues
History
#1 Updated by Bastian Waidelich almost 3 years ago
Good point. Some more ideas for global flags (extract from irc):
some universal flags, like "-context", "-verbose" and so on. We could even add some special parsing so that these universal flags need to be before the command identifier: ./flow -v -c Production cache:warmup
#2 Updated by Karsten Dambekalns almost 3 years ago
Right now it follow the git model ;)
#3 Updated by Karsten Dambekalns almost 3 years ago
- Category set to Cli
#4 Updated by Christopher Hlubek almost 3 years ago
Not exactly, Git also supports git rebase --help
. For long commands this is much more convenient than going back to the beginning and inserting help
. Also ./flow --help
produces an error, which is not very intuitive.
Karsten Dambekalns wrote:
Right now it follow the git model ;)
#5 Updated by Bastian Waidelich almost 3 years ago
Christopher Hlubek wrote:
[...] this is much more convenient than going back to the beginning and inserting
help
[...]
+1 I think, this would be a nice feature!
For the other global flags ("verbose" & "context") I would expect it to work as follows:
if "--verbose" / "-v" is added $this->isVerbose()
returns TRUE.
If "--context" / "-c" is set, the command is transparently executed in that context (this probably has to be parsed before the subrequest is actually dispatched). Also it should probably be possible to specify multiple contexts and/or something like "all" (see #42520).
The question is: How can we tell those global flags from the command arguments? Should we make "verbose", "context" & "help" a protected keyword?
#6 Updated by Bastian Waidelich over 2 years ago
- Subject changed from Command handling should support --help to Command handling should support global flags
Bastian Waidelich wrote:
If "--context" / "-c" is set, the command is transparently executed in that context [...]
Currently it's not possible to determine all defined contexts (a context is implicitly created according to the FLOW_CONTEXT env variable).
An idea to circumvent this is, that a context is only valid if a corresponding directory exists in the global configuration folder, e.g. Configuration/Development/MyContext
This would allow us to fetch all registered (sub)contexts. Also it would make it easier to react to typos in the specified context.
#7 Updated by Bastian Waidelich almost 2 years ago
- Parent task set to #51183
#8 Updated by Bastian Waidelich 5 months ago
- Status changed from New to Closed
- Assigned To set to Bastian Waidelich