From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C641F139086 for ; Mon, 16 Jan 2017 05:53:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 22FD6E0D4F; Mon, 16 Jan 2017 05:53:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 01F4FE0D4F for ; Mon, 16 Jan 2017 05:53:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CB191341016 for ; Mon, 16 Jan 2017 05:53:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4E9162418 for ; Mon, 16 Jan 2017 05:53:32 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1484535820.e46475c945146cd2fe260e6efed68e11df744853.whissi@gentoo> Subject: [gentoo-commits] proj/security:master commit in: bin/ X-VCS-Repository: proj/security X-VCS-Files: bin/cvetool X-VCS-Directories: bin/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: e46475c945146cd2fe260e6efed68e11df744853 X-VCS-Branch: master Date: Mon, 16 Jan 2017 05:53:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 38e33413-35db-4a4a-86db-0fb98970e19f X-Archives-Hash: c01ec76e454e3544043ab6c23aef6c29 commit: e46475c945146cd2fe260e6efed68e11df744853 Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Jan 16 03:03:40 2017 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jan 16 03:03:40 2017 +0000 URL: https://gitweb.gentoo.org/proj/security.git/commit/?id=e46475c9 cvetool: Catch invalid 'info' command usage bin/cvetool | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/cvetool b/bin/cvetool index b8aa5ca..57884ca 100755 --- a/bin/cvetool +++ b/bin/cvetool @@ -22,7 +22,16 @@ class CVETool: self.auth = auth if command == 'info': - self.info(self.cleanup_cve(sys.argv[2])) + if len(args) != 1: + print('Usage: info ') + print('Retrieves information about a CVE from database') + sys.exit(1) + + try: + self.info(self.cleanup_cve(sys.argv[2])) + except ValueError: + print('"{}" is not a valid CVE identifier!'.format(sys.argv[2])) + sys.exit(1) elif command == 'assign': if len(args) < 2: print('Usage: assign [...]')