Permalink
Browse files

add sort command

  • Loading branch information...
1 parent 0d7dee8 commit 95fe4ac6d017232247debae010b92e5f21a0cc88 @marianoguerra committed Mar 30, 2012
Showing with 15 additions and 0 deletions.
  1. +1 −0 bin/@sort
  2. +14 −0 yel/commands.py
View
View
@@ -314,6 +314,20 @@ def process_list(self, items):
items.reverse()
return items
+class Sort(MultiTypeCommand):
+ '''command to sort the received arguments if they are a list
+ leave them untouched otherwise'''
+ SHORT = "sort"
+ LONG = "sort"
+
+ def __init__(self, args, vars_):
+ MultiTypeCommand.__init__(self, args, vars_)
+
+ def process_list(self, items):
+ '''do the process on items'''
+ items.sort()
+ return items
+
class Shuffle(MultiTypeCommand):
'''command to shuffle the content of the arguments if is a list'''
SHORT = "shuffle"

0 comments on commit 95fe4ac

Please sign in to comment.