Revision ed9af02c kamaki/cli/commands/cyclades.py

b/kamaki/cli/commands/cyclades.py
93 93
        limit=IntArgument('limit number of listed VMs', ('-n', '--number')),
94 94
        more=FlagArgument(
95 95
            'output results in pages (-n to set items per page, default 10)',
96
            '--more')
96
            '--more'),
97
        enum=FlagArgument('Enumerate results', '--enumerate')
97 98
    )
98 99

  
99 100
    def _make_results_pretty(self, servers):
......
122 123
        if self['more']:
123 124
            print_items(
124 125
                servers,
125
                page_size=self['limit'] if self['limit'] else 10)
126
                page_size=self['limit'] if self['limit'] else 10,
127
                with_enumeration=self['enum'])
126 128
        else:
127 129
            print_items(
128
                servers[:self['limit'] if self['limit'] else len(servers)])
130
                servers[:self['limit'] if self['limit'] else len(servers)],
131
                with_enumeration=self['enum'])
129 132

  
130 133
    def main(self):
131 134
        super(self.__class__, self)._run()
......
495 498
        limit=IntArgument('limit # of listed flavors', ('-n', '--number')),
496 499
        more=FlagArgument(
497 500
            'output results in pages (-n to set items per page, default 10)',
498
            '--more')
501
            '--more'),
502
        enum=FlagArgument('Enumerate results', '--enumerate')
499 503
    )
500 504

  
501 505
    @errors.generic.all
......
503 507
    def _run(self):
504 508
        flavors = self.client.list_flavors(self['detail'])
505 509
        pg_size = 10 if self['more'] and not self['limit'] else self['limit']
506
        print_items(flavors, with_redundancy=self['detail'], page_size=pg_size)
510
        print_items(
511
            flavors,
512
            with_redundancy=self['detail'],
513
            page_size=pg_size,
514
            with_enumeration=self['enum'])
507 515

  
508 516
    def main(self):
509 517
        super(self.__class__, self)._run()
......
563 571
        limit=IntArgument('limit # of listed networks', ('-n', '--number')),
564 572
        more=FlagArgument(
565 573
            'output results in pages (-n to set items per page, default 10)',
566
            '--more')
574
            '--more'),
575
        enum=FlagArgument('Enumerate results', '--enumerate')
567 576
    )
568 577

  
569 578
    def _make_results_pretty(self, nets):
......
577 586
        if self['detail']:
578 587
            self._make_results_pretty(networks)
579 588
        if self['more']:
580
            print_items(networks, page_size=self['limit'] or 10)
589
            print_items(
590
                networks,
591
                page_size=self['limit'] or 10, with_enumeration=self['enum'])
581 592
        elif self['limit']:
582
            print_items(networks[:self['limit']])
593
            print_items(
594
                networks[:self['limit']],
595
                with_enumeration=self['enum'])
583 596
        else:
584
            print_items(networks)
597
            print_items(networks, with_enumeration=self['enum'])
585 598

  
586 599
    def main(self):
587 600
        super(self.__class__, self)._run()

Also available in: Unified diff