Bug 879834

Summary: RFE: firewall-cmd doesn't accept multiple arguments
Product: [Fedora] Fedora Reporter: Brian Lane <bcl>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: jpopelka, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-07 08:57:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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