-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
@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] |
There was a problem hiding this comment.
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.
8f3e59c
to
0ea953e
Compare
Custom commands | ||
--------------- | ||
|
||
Custom commands, if specified in schema, are also supported by gohan client and should be invoked as follows: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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
0ce5016
to
f95794d
Compare
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
84c57ce
to
519dfd7
Compare
Gohan client will parse custom actions defined in schema and support them in CLI.
519dfd7
to
e991383
Compare
Issue #257
Gohan client will parse custom actions defined in schema
and support them in CLI.