Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'args': 0.04; 'exception.': 0.07; 'subject:How': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:command': 0.09; 'argparse': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'statement.': 0.16; 'subject: \n ': 0.16; 'subject:argparse': 0.16; 'subject:options': 0.16; 'subject:usage': 0.16; 'subject:when': 0.16; 'examples': 0.18; 'command': 0.24; 'header :User-Agent:1': 0.26; 'separate': 0.27; 'options': 0.27; 'header:X -Complaints-To:1': 0.28; 'print': 0.32; 'to:addr:python-list': 0.33; 'subject:?': 0.35; 'received:org': 0.36; 'but': 0.36; 'wanted': 0.36; "didn't": 0.36; 'charset:us-ascii': 0.36; 'instead': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'received:sd.cox.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: rh Subject: How does one make argparse print usage when no options are provided on the command line? Date: Wed, 5 Dec 2012 08:48:30 -0800 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ip184-187-163-27.sb.sd.cox.net User-Agent: dsodnetnin X-Mailer: EZnn0.37p X-Newsreader: EZnn0.37p X-Gmane-NNTP-Posting-Host: EZnn0.37p Original-Received: from slem by 1.1 with local X-No-Archive: yes Archive: no X-Archive: expiry=11 X-Archive: encrypt X-Operating-System: Barebones_6.1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 6 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354726122 news.xs4all.nl 6877 [2001:888:2000:d::a6]:45373 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34294 I have argparse working with one exception. I wanted the program to print out usage when no command line options are given. But I only came across other examples where people didn't use argparse but instead printed out a separate usage statement. So they used argparse for everything but the case where no command line args are given.