Commit a61d22d7 authored by Jacek Sowiński's avatar Jacek Sowiński

Main opts string as constant in CLIApplictionsBase

parent 0e5bb3ba
...@@ -21,6 +21,8 @@ import sys ...@@ -21,6 +21,8 @@ import sys
from six import PY2 from six import PY2
from six.moves import input from six.moves import input
MAIN_OPTS = "c:d:ht:v"
def usage(): def usage():
""" Prints the command-line usage of topydo. """ """ Prints the command-line usage of topydo. """
...@@ -124,7 +126,7 @@ class CLIApplicationBase(object): ...@@ -124,7 +126,7 @@ class CLIApplicationBase(object):
args = [arg.decode('utf-8') for arg in args] args = [arg.decode('utf-8') for arg in args]
try: try:
opts, args = getopt.getopt(args, "c:d:ht:v") opts, args = getopt.getopt(args, MAIN_OPTS)
except getopt.GetoptError as e: except getopt.GetoptError as e:
error(str(e)) error(str(e))
sys.exit(1) sys.exit(1)
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
import sys import sys
import getopt import getopt
from topydo.cli.CLIApplicationBase import MAIN_OPTS
from topydo.cli.CLI import CLIApplication from topydo.cli.CLI import CLIApplication
from topydo.cli.Prompt import PromptApplication from topydo.cli.Prompt import PromptApplication
...@@ -27,7 +28,7 @@ def main(): ...@@ -27,7 +28,7 @@ def main():
args = sys.argv[1:] args = sys.argv[1:]
try: try:
opts, args = getopt.getopt(args, "c:d:ht:v") opts, args = getopt.getopt(args, MAIN_OPTS)
except getopt.GetoptError as e: except getopt.GetoptError as e:
error(str(e)) error(str(e))
sys.exit(1) sys.exit(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment