Added arguments example.

This commit is contained in:
Kenneth Reitz
2011-03-20 15:17:32 -04:00
parent 3b51c67c23
commit ba6f7b87a3
2 changed files with 30 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from clint import args
from clint.textui import puts, colored, indent
with indent(4, quote='>>>'):
puts(colored.red('Aruments passed in: ') + str(args.all))
puts(colored.red('Flags detected: ') + str(args.all_without('py')))
puts(colored.red('Files detected: ') + str(args.files))
puts(colored.red('Grouped Arguments: ') + str(dict(args.grouped)))
print
+12
View File
@@ -0,0 +1,12 @@
echo 'No arguments:'
python args.py
echo 'A few arguments:'
python args.py -s this that --import this and that and this and that
echo 'A few expanded file arguments:'
python args.py *.py
echo 'A few non-expanded file arguments:'
python args.py '*.py'