Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
93c1ea3a
Commit
93c1ea3a
authored
Jun 02, 2016
by
MinchinWeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow `--version` as an alias for `-v`
Add a long version option
parent
14ab34d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
topydo/ui/CLIApplicationBase.py
topydo/ui/CLIApplicationBase.py
+3
-2
topydo/ui/UILoader.py
topydo/ui/UILoader.py
+2
-2
No files found.
topydo/ui/CLIApplicationBase.py
View file @
93c1ea3a
...
@@ -26,6 +26,7 @@ from topydo.lib.Color import AbstractColor, Color
...
@@ -26,6 +26,7 @@ from topydo.lib.Color import AbstractColor, Color
from
topydo.lib.TopydoString
import
TopydoString
from
topydo.lib.TopydoString
import
TopydoString
MAIN_OPTS
=
"ac:C:d:ht:v"
MAIN_OPTS
=
"ac:C:d:ht:v"
MAIN_LONG_OPTS
=
(
'version'
)
READ_ONLY_COMMANDS
=
(
'List'
,
'ListContext'
,
'ListProject'
)
READ_ONLY_COMMANDS
=
(
'List'
,
'ListContext'
,
'ListProject'
)
...
@@ -171,7 +172,7 @@ class CLIApplicationBase(object):
...
@@ -171,7 +172,7 @@ class CLIApplicationBase(object):
args
=
sys
.
argv
[
1
:]
args
=
sys
.
argv
[
1
:]
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
)
opts
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
,
MAIN_LONG_OPTS
)
except
getopt
.
GetoptError
as
e
:
except
getopt
.
GetoptError
as
e
:
error
(
str
(
e
))
error
(
str
(
e
))
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -191,7 +192,7 @@ class CLIApplicationBase(object):
...
@@ -191,7 +192,7 @@ class CLIApplicationBase(object):
overrides
[(
'topydo'
,
'filename'
)]
=
value
overrides
[(
'topydo'
,
'filename'
)]
=
value
elif
opt
==
"-d"
:
elif
opt
==
"-d"
:
overrides
[(
'topydo'
,
'archive_filename'
)]
=
value
overrides
[(
'topydo'
,
'archive_filename'
)]
=
value
elif
opt
==
"-v"
:
elif
opt
in
(
"-v"
,
"--version"
)
:
version
()
version
()
else
:
else
:
self
.
_usage
()
self
.
_usage
()
...
...
topydo/ui/UILoader.py
View file @
93c1ea3a
...
@@ -20,7 +20,7 @@ import getopt
...
@@ -20,7 +20,7 @@ import getopt
import
sys
import
sys
from
topydo.ui.cli.CLI
import
CLIApplication
from
topydo.ui.cli.CLI
import
CLIApplication
from
topydo.ui.CLIApplicationBase
import
MAIN_OPTS
,
error
from
topydo.ui.CLIApplicationBase
import
MAIN_OPTS
,
MAIN_LONG_OPTS
,
error
# enable color on windows CMD
# enable color on windows CMD
if
"win32"
in
sys
.
platform
:
if
"win32"
in
sys
.
platform
:
...
@@ -34,7 +34,7 @@ def main():
...
@@ -34,7 +34,7 @@ def main():
args
=
sys
.
argv
[
1
:]
args
=
sys
.
argv
[
1
:]
try
:
try
:
_
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
)
_
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
,
MAIN_LONG_OPTS
)
except
getopt
.
GetoptError
as
e
:
except
getopt
.
GetoptError
as
e
:
error
(
str
(
e
))
error
(
str
(
e
))
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment