Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom actions in client #283

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

abonie
Copy link

@abonie abonie commented Aug 18, 2016

Issue #257

Gohan client will parse custom actions defined in schema
and support them in CLI.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.333% when pulling f45abe5 on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@marcin-ptaszynski
Copy link
Contributor

@abonie , I think you should update document additional client commands here https://github.com/cloudwan/gohan/blob/master/docs/source/commands.rst#command

if _, ok := commonParams[key]; !ok {
return nil, fmt.Errorf("Error parsing parameter %s", key)
}
value := args[i+1]
Copy link
Contributor

@marcin-ptaszynski marcin-ptaszynski Aug 18, 2016

Choose a reason for hiding this comment

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

isn't it going to crash if we pass odd number of arguments, like gohan client action --opt1 value1 --opt2?
EDIT: oh, I see, splitArgs ensures that arg number is even before this function is called.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.333% when pulling 8f3e59c on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@abonie abonie force-pushed the support_custom_actions_in_client branch from 8f3e59c to 0ea953e Compare August 19, 2016 15:16
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.333% when pulling 0ea953e on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

Custom commands
---------------

Custom commands, if specified in schema, are also supported by gohan client and should be invoked as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no reference to Actions.

Copy link
Author

Choose a reason for hiding this comment

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

I don't get it. Unless you mean, that it should say "Custom actions" instead of "Custom commands"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly that. user may not know that custom commands are generated from Custom Actions defined in https://github.com/cloudwan/gohan/blob/master/docs/source/schema.rst#custom-actions-schema

@abonie abonie force-pushed the support_custom_actions_in_client branch from 0ce5016 to f95794d Compare August 23, 2016 07:56
Custom commands
---------------

Any `custom actions <./schema.rst/#custom-actions-schema>`_ specified in schema are also supported as commands by gohan client and should be invoked as follows:
Copy link
Author

Choose a reason for hiding this comment

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

I don't really know anything about creating docs from .rst format, so someone should please verify, that this link doesn't break

Copy link
Contributor

Choose a reason for hiding this comment

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

You can easily verify it with:

sudo pip install sphinx
cd ./docs
make html

Results can be found in build directory.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.333% when pulling f95794d on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.333% when pulling f95794d on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@abonie abonie force-pushed the support_custom_actions_in_client branch 2 times, most recently from 84c57ce to 519dfd7 Compare August 24, 2016 08:15
Gohan client will parse custom actions defined in schema
and support them in CLI.
@abonie abonie force-pushed the support_custom_actions_in_client branch from 519dfd7 to e991383 Compare August 24, 2016 08:16
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.359% when pulling e991383 on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.343% when pulling e991383 on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.335% when pulling e991383 on abonie:support_custom_actions_in_client into 431510b on cloudwan:master.

@nati nati merged commit 4669249 into cloudwan:master Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants