openSUSE / docmanager

Manage DocBook 5 Meta Information
http://opensuse.github.io/docmanager/index.html
GNU General Public License v3.0
6 stars 6 forks source link

Omit the -f/--file option #8

Closed tomschr closed 9 years ago

tomschr commented 9 years ago

According to the README and --help, docmanager needs a -f or --files option. IMHO this is unnecessary and should be removed.

For example, git, svn, and many other commands usually don't have a -f option to operate on their file list. They just use it without such an option. The requirement of -f looks "unnatural" to me.

For that reason, I would suggest to change this code in __init__.py:

diff --git i/docmanager/__init__.py w/docmanager/__init__.py                                                                 
index a4047bf..9f0580a 100644
--- i/docmanager/__init__.py
+++ w/docmanager/__init__.py
@@ -37,12 +37,8 @@ class ArgParser:
         self.parse_arguments()

     def add_arguments(self):
-        file_group = self.__parser.add_argument_group("Files")
-        file_group.add_argument(
-                    "-f",
-                    "--files",
-                    nargs="+",
-                    required=True,
+        self.__parser.add_argument("FILES",
+                    nargs="+",
+                    dest="files",
                     help="One or more DocBook XML or DC files."
                 )

With that change, you can use docmanager like this:

docmanager --set maintainer=test_name version=test_version test_file1.xml test_file2.xml

What do you think? Is there any special reason to use -f?

mschnitzer commented 9 years ago

I'm not sure with that because it is a bit more cleaner than the option without -f

rsalevsky commented 9 years ago

There was a problem without this option, but I have no idea which it was.

mschnitzer commented 9 years ago

I just want to pick this discussion up again: I think it makes it definitely cleaner if we have a special option for that.

Example:

--set maintainer=test_name version=version file.xml file2.xml

It's not cleaner than:

--set maintainer=test_name version=verson --file file.xml file2.xml 
rsalevsky commented 9 years ago

I agree, you can test it and when there are no problems then I'm fine with this idea.