Bug 879834 - RFE: firewall-cmd doesn't accept multiple arguments
Summary: RFE: firewall-cmd doesn't accept multiple arguments
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: firewalld
Version: 18
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-24 18:35 UTC by Brian Lane
Modified: 2013-06-07 08:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-07 08:57:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Brian Lane 2012-11-24 18:35:49 UTC
sudo firewall-cmd --add-port=80/tcp --add-port=443/tcp 

doesn't work. It also doesn't throw an error, it just doesn't do anything.

I also notice that the argument parsing being used is fairly crude. Python has the excellent argparse module which will create your usage output for you and can be used to modularize the options, set required options, etc.

Comment 1 Thomas Woerner 2013-01-03 19:01:59 UTC
Marking as an RFE. Using this will also fix #874912.

Comment 2 Jiri Popelka 2013-02-14 17:41:37 UTC
(In reply to comment #0)
> sudo firewall-cmd --add-port=80/tcp --add-port=443/tcp 
> doesn't work. It also doesn't throw an error, it just doesn't do anything.

Added upstream
http://git.fedorahosted.org/cgit/firewalld.git/commit/?id=1bb7ba26af1de1ffba65f4232d5ea06c24d07393
 
> I also notice that the argument parsing being used is fairly crude. Python
> has the excellent argparse module 

Upstream firewall-cmd has been using argparse since
http://git.fedorahosted.org/cgit/firewalld.git/commit/?id=1b7d5908f1018e883dded781b4d073cc18b8045c

> which will create your usage output for
> you and can be used to modularize the options, set required options, etc.

Yes, the generated usage is nice.
Problem is that we have so many options and some of them are dependent on others
so it's almost impossible to set the parser for the generated usage to look nice.
Splitting (like in bug #876394, comment #2) them to sub-commands [1] would probably solve this, but it'd also change the syntax completely and I'm not sure it's what we want now.

[1] http://docs.python.org/dev/library/argparse.html#sub-commands

Comment 3 Jiri Popelka 2013-06-07 08:57:13 UTC
Fixed since 0.3.0


Note You need to log in before you can comment on or make changes to this bug.