Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dan Strohl Newsgroups: comp.lang.python Subject: RE: What should Python apps do when asked to show help? Date: Thu, 28 Apr 2016 17:32:29 +0000 Lines: 49 Message-ID: References: <57223b76$0$22140$c3e8da3$5496439d@news.astraweb.com> <57224382$0$5808$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 0qkAE7uBs4LQXiFQCW75lQC0fXMLUvoUw4C2xmWdZMng== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'subject:Python': 0.05; 'differently': 0.07; 'option,': 0.07; 'tool,': 0.07; 'subject:help': 0.07; 'stdout': 0.09; 'python': 0.10; 'thursday,': 0.13; 'apps': 0.15; 'message-----': 0.15; 'things.': 0.15; '--help': 0.16; '2016': 0.16; 'help?': 0.16; 'idea:': 0.16; 'keypress': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'skip:[ 50': 0.16; 'subject:show': 0.16; 'subject:when': 0.16; 'think?': 0.16; 'using,': 0.16; 'wrote:': 0.16; 'to:name:python-list@python.org': 0.20; 'to:2**1': 0.21; 'default,': 0.22; 'environments': 0.22; 'pipe': 0.22; 'bit': 0.23; '(or': 0.23; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'command': 0.26; 'figure': 0.27; 'dan': 0.29; 'received:192.168.10': 0.29; 'asked': 0.29; 'print': 0.30; 'url:mailman': 0.30; 'normally': 0.30; 'programmers': 0.30; 'option': 0.31; 'run': 0.33; 'url:python': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'skip:- 10': 0.34; 'url:listinfo': 0.34; 'so,': 0.35; 'sent:': 0.35; 'next': 0.35; 'text': 0.35; 'subject:': 0.35; 'but': 0.36; 'too': 0.36; 'should': 0.36; 'needed': 0.36; 'url:org': 0.36; 'tool': 0.36; 'email addr:python.org': 0.36; 'cases': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'operating': 0.37; 'setting': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'doing': 0.38; 'end': 0.39; 'application': 0.39; "didn't": 0.39; 'from:': 0.39; 'received:192': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'where': 0.40; 'still': 0.40; 'waiting': 0.60; 'show': 0.62; 'different': 0.63; 'times': 0.63; 'python-list': 0.66; 'email name :python-list': 0.67; 'hesitate': 0.71; 'received:192.168.15': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=f5.com; i=@f5.com; q=dns/txt; s=seattle; t=1461864753; x=1493400753; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=4hssFO/p39KP5Koav8GC6qOxOJEN1KO6wOFia8yvVfc=; b=UKJVPNNLkU+a68pgHs46ZgMi6jOEw+Yj6shQQKgjOLSNvC6OyOVo9sjt r2LeK9tf6aYDriSVHNotD1tMj70PDNkqp5FQbsZi7gQ05vnDq4XYJXJ+u IWNK07MbK7QirdVUhKubfnI2cDuQz8/PkHqzUDuYBGqQ7JZ9RPf7yQiMB Q=; X-IronPort-AV: E=Sophos;i="5.24,547,1454976000"; d="scan'208";a="216225974" Thread-Topic: What should Python apps do when asked to show help? Thread-Index: AQHRoWw0yo/CeHHw+k+f9dhTV82UOp+gE5kA//+PnuA= In-Reply-To: <57224382$0$5808$e4fe514c@news.xs4all.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.15.239] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <57223b76$0$22140$c3e8da3$5496439d@news.astraweb.com> <57224382$0$5808$e4fe514c@news.xs4all.nl> Xref: csiph.com comp.lang.python:107816 I would hesitate to take this approach unless the tool was one that only I = was going to be using, and I knew exactly what environments it was going to= be in. I know that many of the system items in python work differently in differen= t operating systems, and different os's report things differently as well a= s different ways of launching things. So, for example, I have seen cases w= here tools such as webmin will try to run a command line tool, and end up h= ung because they are waiting on a keypress for the next screen...=20 While I might do it as a way of setting a default, I would still want to ha= ve the ability to force a pager, or force no pager. I've been bit too many= times by programmers doing things automatically for me that I didn't want. I think that most people who use command line tools these days will be able= to figure out how to pipe it to "more" if needed (or whatever). Dan > -----Original Message----- > From: Python-list [mailto:python-list-bounces+d.strohl=3Df5.com@python.or= g] > On Behalf Of Irmen de Jong > Sent: Thursday, April 28, 2016 10:08 AM > To: python-list@python.org > Subject: Re: What should Python apps do when asked to show help? >=20 > On 28-4-2016 18:33, Steven D'Aprano wrote: >=20 >=20 > > but I was thinking of doing both: give my application a subcommand or > > an option to display help directly in a pager, while -h and --help > > print to stdout as normal. > > > > What do you think? Too clever? >=20 > An idea: Use just one help option, then >=20 > if sys.stdout.isatty(): > #....use a pager to display help text > else: > #....print all help text normally >=20 >=20 > Irmen >=20 > -- > https://mail.python.org/mailman/listinfo/python-list