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
bf81c6fe
Commit
bf81c6fe
authored
Nov 08, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give command the ability to define its own set of flags.
parent
8d2fa4de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
topydo/lib/DCommand.py
topydo/lib/DCommand.py
+12
-1
No files found.
topydo/lib/DCommand.py
View file @
bf81c6fe
...
...
@@ -40,12 +40,23 @@ class DCommand(Command):
except
(
InvalidCommandArgument
,
InvalidTodoException
):
self
.
todo
=
None
def
get_flags
(
self
):
""" Default implementation of getting specific flags. """
return
(
""
,
[])
def
process_flag
(
self
):
""" Default implementation of processing specific flags. """
pass
def
process_flags
(
self
):
opts
,
args
=
self
.
getopt
(
"f"
,
[
"force"
])
opts
,
args
=
self
.
get_flags
()
opts
,
args
=
self
.
getopt
(
"f"
+
opts
,
[
"force"
]
+
args
)
for
opt
,
value
in
opts
:
if
opt
==
"-f"
or
opt
==
"--force"
:
self
.
force
=
True
else
:
self
.
process_flag
(
opt
,
value
)
self
.
args
=
args
...
...
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