Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console] Show hidden commands in json & xml descriptors#21075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/console/show_hidden_cmd_json_xml
Jan 4, 2017
Merged

[Console] Show hidden commands in json & xml descriptors#21075

fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/console/show_hidden_cmd_json_xml
Jan 4, 2017

Conversation

@ogizanagi
Copy link
Contributor

QA
Branch?master
Bug fix?no (may be considered, but as hidden commands did not exist before 3.2, looks more like a behavior change, hence a feature)
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#20866 (comment)
LicenseMIT
Doc PRN/A

@ro0NL
Copy link
Contributor

Nice 👍 what aboutbin/console list --show-hidden? The idea of hidden commands was to exclude them by default (for not having a contextual relevance).

@ogizanagi
Copy link
ContributorAuthor

Looks like an idea to me :)

But I'd like to keep meaningful defaults based on the format unless the--show-hidden flag is provided/explicitly set totrue/false (InputOption::VALUE_OPTIONAL with default acting as auto).

Anyway, let's first approve this one before.

@ro0NL
Copy link
Contributor

ro0NL commentedDec 28, 2016
edited
Loading

meaningful defaults based on the format

Technically they dont know about each other.. they should not make assumptions regarding context imo. The only context we do have is "hidden", probably meaning; dont bother the user with it.

So 👍 for defaulting to false, where defaulting is needed. But i understand you actually chose to differ between XML/JSON and markdown here. Always providing the information technically in that case.

I think we should do format based decision making at command level. More close to real user decision making. Although it could still be experienced counter-intuitive. No real opinion here :)

Anyway, let's first approve this one before.

Im not sure you wanna do 2 PR's? But imo. it can be 1, doing the feature as a whole. Right now master is good (imo.); consistently hidden by default. Not sure we want this intermediate step, or as final solution for that matter, again imo.

For me 👍 adding--show-hidden to bypass the hardcoded default.

@ogizanagi
Copy link
ContributorAuthor

ogizanagi commentedDec 28, 2016
edited
Loading

Im not sure you wanna do 2 PR's? But imo. it can be 1, doing the feature as a whole.

Just waiting for some more feedbacks on this and the option suggestion.

But ok, done.

@fabpot
Copy link
Member

I think I'm 👎 on the--show-hidden option. That would defeat the whole purpose of the hidden feature as accepted when it was introduced.

@ro0NL
Copy link
Contributor

Sounds reasonable. But it really depends what "hidden" means. Is it only from a end-user perspective? GUI-wise?

Then the initial (by now ;-)) approach makes sense. Including for technical formats, excluding for human formats.

Copy link
Contributor

@ro0NLro0NL left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM 👍 basically only having the console option yes/no is questionable.

Status: Reviewed

$description =newApplicationDescription($application,$namespace);
$namespace =isset($options['namespace']) ?$options['namespace'] :null;
$showHidden =isset($options['show_hidden']) ?$options['show_hidden'] :false;
$description =newApplicationDescription($application,$namespace,$showHidden);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Getting aApplicationDescription from options looks tedious..

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What do you mean? 😕

Copy link
Contributor

@ro0NLro0NLDec 28, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Descriptor::getApplicationDescription($options) could be worth it by now (2 options * 4 descriptors)

ogizanagi reacted with thumbs up emoji

####`--show-hidden`

To show hidden commands
Copy link
Contributor

@ro0NLro0NLDec 28, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

MaybeTo include hidden commands, it kinda implies we lose the other ones. Anyway this made me doubt between--show-hidden and--with-hidden. Im fine either way, but perhaps be explicit in its description.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why not.include indeed looks better to me :)

* @param string|null $namespace
* @param bool $showHidden
*/
publicfunction__construct(Application$application,$namespace =null)
Copy link
Contributor

@ro0NLro0NLDec 28, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This feature is good for sure 👍 same for updated outputs.

newInputArgument('namespace', InputArgument::OPTIONAL,'The namespace name'),
newInputOption('raw',null, InputOption::VALUE_NONE,'To output raw command list'),
newInputOption('format',null, InputOption::VALUE_REQUIRED,'The output format (txt, xml, json, or md)','txt'),
newInputOption('show-hidden',null, InputOption::VALUE_NONE,'To show hidden commands'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No opinion (as we can also use application descriptors in code, so as calling commands).

@ogizanagi
Copy link
ContributorAuthor

There is one more thing to consider regarding the--show-hidden option: It feels strange for bothxml andjson formats to get thehidden information always added as an attribute. If it doesn't include hidden commands, this is pretty useless.

I'll wait some more opinions and remove the option if it doesn't seem appropriated.

@ro0NL
Copy link
Contributor

Not sure, we wanna micro optimize that? The definition is clear, allowing everybody to rely on it consistently.

*/
protectedfunctiondescribeApplication(Application$application,array$options =array())
{
$describedNamespace =isset($options['namespace']) ?$options['namespace'] :null;
Copy link
Contributor

@ro0NLro0NLDec 28, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The suggestion ofgetApplicationDescription was to move (global) option management to a single place. Keeping this doesnt solve that, gaining only 1 option * 4 descriptors.

Imo. we should rely on some$description->getNamespace() as of below, otherwise maybe revert.

ogizanagi reacted with thumbs up emoji
@fabpot
Copy link
Member

"Then the initial (by now ;-)) approach makes sense. Including for technical formats, excluding for human formats." -> like that.

@ogizanagi
Copy link
ContributorAuthor

--show-hidden option removed :)

{
$describedNamespace =isset($options['namespace']) ?$options['namespace'] :null;
$description =newApplicationDescription($application,$describedNamespace);
$description =newApplicationDescription($application,$describedNamespace,true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Imo. the descriptor option was nice :) anyway it's internal code.. we're good 👍

@nicolas-grekasnicolas-grekas added this to the3.x milestoneJan 2, 2017
@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commitb6cf240 intosymfony:masterJan 4, 2017
fabpot added a commit that referenced this pull requestJan 4, 2017
…rs (ogizanagi)This PR was merged into the 3.3-dev branch.Discussion----------[Console] Show hidden commands in json & xml descriptors| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no (may be considered, but as hidden commands did not exist before 3.2, looks more like a behavior change, hence a feature)| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#20866 (comment)| License       | MIT| Doc PR        | N/ACommits-------b6cf240 [Console] Show hidden commands in json & xml descriptors
@ogizanagiogizanagi deleted the feature/console/show_hidden_cmd_json_xml branchJanuary 4, 2017 14:30
@nicolas-grekasnicolas-grekas modified the milestone:3.xMar 24, 2017
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@ogizanagi@ro0NL@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp