From 99dbf8119aa9908cb6121d2e4d0f0f9495600ad7 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Mon, 4 Dec 2017 16:15:01 -0600 Subject: [PATCH] add-source: don't use flags for options Instead making name and url positional args. We can add a flag to change the meaning of the URL later. --- doc/add-source.rst | 12 +----------- suricata/update/commands/addsource.py | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/doc/add-source.rst b/doc/add-source.rst index 77677da..0974731 100644 --- a/doc/add-source.rst +++ b/doc/add-source.rst @@ -7,7 +7,7 @@ Synopsis :: - suricata-update add-source [--name name] [--url ] + suricata-update add-source Description =========== @@ -18,14 +18,4 @@ URL. It is useful to add a source that is not provided in the index. Options ======= -.. option:: --name - - The name of the source. If not provided on the command line the - user will be prompted. - -.. option:: --url - - The URL of the source. If not provided on the command line the user - will be prompted. - .. include:: ./common-options.rst diff --git a/suricata/update/commands/addsource.py b/suricata/update/commands/addsource.py index cdff4d1..e53db37 100644 --- a/suricata/update/commands/addsource.py +++ b/suricata/update/commands/addsource.py @@ -23,8 +23,8 @@ from suricata.update import sources logger = logging.getLogger() def register(parser): - parser.add_argument("--name", metavar="", help="Name of source") - parser.add_argument("--url", metavar="", help="Source URL") + parser.add_argument("name", metavar="", help="Name of source") + parser.add_argument("url", metavar="", help="Source URL") parser.set_defaults(func=add_source) def add_source(config): -- 2.47.3