From patchwork Tue Oct 7 21:02:17 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McHardy X-Patchwork-Id: 3212 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id EED81DDF0F for ; Wed, 8 Oct 2008 08:03:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756769AbYJGVDg (ORCPT ); Tue, 7 Oct 2008 17:03:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756586AbYJGVDg (ORCPT ); Tue, 7 Oct 2008 17:03:36 -0400 Received: from stinky.trash.net ([213.144.137.162]:59690 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754054AbYJGVDf (ORCPT ); Tue, 7 Oct 2008 17:03:35 -0400 Received: from [192.168.1.100] (unknown [78.42.204.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by stinky.trash.net (Postfix) with ESMTP id 73F75948A7; Tue, 7 Oct 2008 23:03:33 +0200 (MEST) Message-ID: <48EBCE59.3080401@trash.net> Date: Tue, 07 Oct 2008 23:02:17 +0200 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Arkadiusz Miskiewicz CC: Linux Netdev List , Stephen Hemminger Subject: Re: [IPROUTE]: Fix up "ip link" help text References: <48EB7D76.7050004@trash.net> <200810072206.03062.arekm@maven.pl> In-Reply-To: <200810072206.03062.arekm@maven.pl> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Arkadiusz Miskiewicz wrote: > Runtime dependand help doesn't look sane. Help should always show all possible > options/command while trying to use unsupported option should display error > message. > That makes sense. But don't complain to me about the quality of the error messages afterwards please :) commit 8c6321466df9a452ac58e09d32edd6c5b4ea0d17 Author: Patrick McHardy Date: Tue Oct 7 23:00:59 2008 +0200 [IPROUTE]: Fix up "ip link" help text Add help for "ip link add". Also fix up the "ip link set" help text: - the flags are not mutually exclusive as suggested by the current text, up/down states and on/off are mutually exclusive. - txqueuelen, name etc. have nothing to do with the flags and on/off states at all and are certainly not mutually exclusive, fix formatting and make it conform the other helptexts better. Signed-off-by: Patrick McHardy diff --git a/ip/iplink.c b/ip/iplink.c index 6e9ac71..781fbd2 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -41,19 +41,30 @@ static void usage(void) __attribute__((noreturn)); void iplink_usage(void) { - fprintf(stderr, "Usage: ip link set DEVICE { up | down |\n"); - fprintf(stderr, " arp { on | off } |\n"); - fprintf(stderr, " dynamic { on | off } |\n"); - fprintf(stderr, " multicast { on | off } |\n"); - fprintf(stderr, " allmulticast { on | off } |\n"); - fprintf(stderr, " promisc { on | off } |\n"); - fprintf(stderr, " trailers { on | off } |\n"); - fprintf(stderr, " txqueuelen PACKETS |\n"); - fprintf(stderr, " name NEWNAME |\n"); - fprintf(stderr, " address LLADDR | broadcast LLADDR |\n"); - fprintf(stderr, " mtu MTU }\n"); - fprintf(stderr, " netns PID }\n"); + fprintf(stderr, "Usage: ip link add [ name ] NAME\n"); + fprintf(stderr, " [ link DEV ]\n"); + fprintf(stderr, " [ txqueuelen PACKETS ]\n"); + fprintf(stderr, " [ address LLADDR ]\n"); + fprintf(stderr, " [ broadcast LLADDR ]\n"); + fprintf(stderr, " [ mtu MTU ]\n"); + fprintf(stderr, " type TYPE [ ARGS ]\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " ip link set DEVICE [ { up | down } ]\n"); + fprintf(stderr, " [ arp { on | off } ]\n"); + fprintf(stderr, " [ dynamic { on | off } ]\n"); + fprintf(stderr, " [ multicast { on | off } ]\n"); + fprintf(stderr, " [ allmulticast { on | off } ]\n"); + fprintf(stderr, " [ promisc { on | off } ]\n"); + fprintf(stderr, " [ trailers { on | off } ]\n"); + fprintf(stderr, " [ txqueuelen PACKETS ]\n"); + fprintf(stderr, " [ name NEWNAME ]\n"); + fprintf(stderr, " [ address LLADDR ]\n"); + fprintf(stderr, " [ broadcast LLADDR ]\n"); + fprintf(stderr, " [ mtu MTU ]\n"); + fprintf(stderr, " [ netns PID ]\n"); fprintf(stderr, " ip link show [ DEVICE ]\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "TYPE := { vlan | veth | dummy | ifb | macvlan }\n"); exit(-1); }