changeset 164:2e87f04880ab

Make fancyopts handle no arguments This lets hg serve work with no args.
author mpm@selenic.com
date Thu, 26 May 2005 09:56:20 -0800
parents f38c90953c2c
children 7fc8385df514
files mercurial/fancyopts.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fancyopts.py	Thu May 26 09:48:50 2005 -0800
+++ b/mercurial/fancyopts.py	Thu May 26 09:56:20 2005 -0800
@@ -1,6 +1,6 @@
 import sys, os, getopt
 
-def fancyopts(args, options, state, syntax=''):
+def fancyopts(args, options, state, syntax='', minlen = 0):
     long=[]
     short=''
     map={}
@@ -18,7 +18,7 @@
             if c: print '   %s' % c
         sys.exit(0)
 
-    if len(args) == 0:
+    if len(args) < minlen:
         help(state, None, args)
 
     options=[('h', 'help', help, 'Show usage info')] + options