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
e66f7c2d
Commit
e66f7c2d
authored
May 04, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16 from mruwek/edit-donetxt
Edit the archive file with '-d' option.
parents
0d570f8a
e8bb8b81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
topydo/lib/EditCommand.py
topydo/lib/EditCommand.py
+14
-4
No files found.
topydo/lib/EditCommand.py
View file @
e66f7c2d
...
...
@@ -32,12 +32,15 @@ class EditCommand(MultiCommand, ListCommand):
p_error
,
p_input
)
self
.
is_expression
=
False
self
.
edit_archive
=
False
def
_process_flags
(
self
):
opts
,
args
=
self
.
getopt
(
'xe'
)
opts
,
args
=
self
.
getopt
(
'xe
d
'
)
for
opt
,
value
in
opts
:
if
opt
==
'-x'
:
if
opt
==
'-d'
:
self
.
edit_archive
=
True
elif
opt
==
'-x'
:
self
.
show_all
=
True
elif
opt
==
'-e'
:
self
.
is_expression
=
True
...
...
@@ -101,6 +104,11 @@ class EditCommand(MultiCommand, ListCommand):
else
:
self
.
_process_flags
()
if
self
.
edit_archive
:
archive
=
config
().
archive
()
return
call
([
editor
,
archive
])
==
0
if
self
.
is_expression
:
self
.
todos
=
self
.
_view
().
_viewdata
else
:
...
...
@@ -136,7 +144,8 @@ class EditCommand(MultiCommand, ListCommand):
return
"""Synopsis:
edit
edit <NUMBER1> [<NUMBER2> ...]
edit -e [-x] [expression]"""
edit -e [-x] [expression]
edit -d"""
def
help
(
self
):
return
"""
\
...
...
@@ -145,7 +154,7 @@ Launches a text editor to edit todos.
Without any arguments it will just open the todo.txt file. Alternatively it can
edit todo item(s) with the given number(s) or edit relevant todos matching
the given expression. See `topydo help ls` for more information on relevant
todo items.
todo items.
It is also possible to open the archive file.
By default it will use $EDITOR in your environment, otherwise it will fall back
to 'vi'.
...
...
@@ -153,4 +162,5 @@ to 'vi'.
-e : Treat the subsequent arguments as an expression.
-x : Edit *all* todos matching the expression (i.e. do not filter on
dependencies or relevance).
-d : Open the archive file.
"""
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