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
3a05c307
Commit
3a05c307
authored
Jun 03, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #130 from MinchinWeb/version-option
Allow `--version` as an alias for `-v`
parents
1d19ce3d
93c1ea3a
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 @
3a05c307
...
...
@@ -26,6 +26,7 @@ from topydo.lib.Color import AbstractColor, Color
from
topydo.lib.TopydoString
import
TopydoString
MAIN_OPTS
=
"ac:C:d:ht:v"
MAIN_LONG_OPTS
=
(
'version'
)
READ_ONLY_COMMANDS
=
(
'List'
,
'ListContext'
,
'ListProject'
)
...
...
@@ -171,7 +172,7 @@ class CLIApplicationBase(object):
args
=
sys
.
argv
[
1
:]
try
:
opts
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
)
opts
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
,
MAIN_LONG_OPTS
)
except
getopt
.
GetoptError
as
e
:
error
(
str
(
e
))
sys
.
exit
(
1
)
...
...
@@ -191,7 +192,7 @@ class CLIApplicationBase(object):
overrides
[(
'topydo'
,
'filename'
)]
=
value
elif
opt
==
"-d"
:
overrides
[(
'topydo'
,
'archive_filename'
)]
=
value
elif
opt
==
"-v"
:
elif
opt
in
(
"-v"
,
"--version"
)
:
version
()
else
:
self
.
_usage
()
...
...
topydo/ui/UILoader.py
View file @
3a05c307
...
...
@@ -20,7 +20,7 @@ import getopt
import
sys
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
if
"win32"
in
sys
.
platform
:
...
...
@@ -34,7 +34,7 @@ def main():
args
=
sys
.
argv
[
1
:]
try
:
_
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
)
_
,
args
=
getopt
.
getopt
(
args
,
MAIN_OPTS
,
MAIN_LONG_OPTS
)
except
getopt
.
GetoptError
as
e
:
error
(
str
(
e
))
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