[ 
https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004622#comment-16004622
 ] 

ASF GitHub Bot commented on ARIA-148:
-------------------------------------

Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/107#discussion_r115729149
  
    --- Diff: aria/cli/commands/service_templates.py ---
    @@ -43,32 +45,51 @@ def service_templates():
     @aria.argument('service-template-name')
     @aria.options.verbose()
     @aria.pass_model_storage
    +@aria.options.show_all
    +@aria.options.show_types
    +@aria.options.show_json
    +@aria.options.show_yaml
     @aria.pass_logger
    -def show(service_template_name, model_storage, logger):
    -    """Show information for a specific service templates
    +def show(service_template_name, model_storage, all, types, json, yaml, 
logger):
    +    """Show information for a specific service template
     
         `SERVICE_TEMPLATE_NAME` is the name of the service template to show 
information on.
         """
    -    logger.info('Showing service template 
{0}...'.format(service_template_name))
         service_template = 
model_storage.service_template.get_by_name(service_template_name)
    -    service_template_dict = service_template.to_dict()
    -    service_template_dict['#services'] = len(service_template.services)
     
    -    column_formatters = \
    -        
dict(description=table.trim_formatter_generator(DESCRIPTION_FIELD_LENGTH_LIMIT))
    -    columns = SERVICE_TEMPLATE_COLUMNS + ['#services']
    -    table.print_data(columns, service_template_dict, 'Service-template:',
    -                     column_formatters=column_formatters, col_max_width=50)
    -
    -    if service_template_dict['description'] is not None:
    -        logger.info('Description:')
    -        
logger.info('{0}{1}'.format(service_template_dict['description'].encode('UTF-8')
 or '',
    -                                    os.linesep))
    -
    -    if service_template.services:
    -        logger.info('Existing services:')
    -        for service in service_template.services:
    -            logger.info('\t{0}'.format(service.name))
    +    if json or yaml:
    --- End diff --
    
    i'm a bit confused by this. so `yaml`, `json`, and `all` all mean all,
    and `json` and `yaml` can be used simulatniously but only `json` will get 
printed.
    
    Re the latter problem, please have a look at `aria.py` for how to make 
flags mutually-exclusive.
    re the former, it might be better to also have the `all` flag as 
mutually-exclusive with the other two..


> Enhance CLI "show" commands
> ---------------------------
>
>                 Key: ARIA-148
>                 URL: https://issues.apache.org/jira/browse/ARIA-148
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Tal Liron
>            Assignee: Tal Liron
>
> For {{aria service-templates show}} and {{aria services show}} add support 
> for dumping, including graphs and type hierarchies, in JSON and YAML.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to