]> git.notmuchmail.org Git - notmuch/blob - notmuch
nonfunctional changes in notmuch stub
[notmuch] / notmuch
1 #!/usr/bin/env python
2 """This is a notmuch implementation in python. It's goal is to allow running the test suite on the cnotmuch python bindings."""
3 import sys
4 from cnotmuch import notmuch
5
6 #-------------------------------------------------------------------------
7 HELPTEXT="""The notmuch mail system.
8
9 Usage: notmuch <command> [args...]
10
11 Where <command> and [args...] are as follows:
12
13         setup   Interactively setup notmuch for first use.
14
15         new     [--verbose]
16
17                 Find and import new messages to the notmuch database.
18
19         search  [options...] <search-terms> [...]
20
21                 Search for messages matching the given search terms.
22
23         show    <search-terms> [...]
24
25                 Show all messages matching the search terms.
26
27         count   <search-terms> [...]
28
29                 Count messages matching the search terms.
30
31         reply   [options...] <search-terms> [...]
32
33                 Construct a reply template for a set of messages.
34
35         tag     +<tag>|-<tag> [...] [--] <search-terms> [...]
36
37                 Add/remove tags for all messages matching the search terms.
38
39         dump    [<filename>]
40
41                 Create a plain-text dump of the tags for each message.
42
43         restore <filename>
44
45                 Restore the tags from the given dump file (see 'dump').
46
47         search-tags     [<search-terms> [...] ]
48
49                 List all tags found in the database or matching messages.
50
51         help    [<command>]
52
53                 This message, or more detailed help for the named command.
54
55 Use "notmuch help <command>" for more details on each command.
56 And "notmuch help search-terms" for the common search-terms syntax.
57 """
58 #-------------------------------------------------------------------------
59 #TODO: replace the dynamic pieces
60 USAGE="""Notmuch is configured and appears to have a database. Excellent!
61
62 At this point you can start exploring the functionality of notmuch by
63 using commands such as:
64
65         notmuch search tag:inbox
66
67         notmuch search to:"Sebastian Spaeth"
68
69         notmuch search from:"Sebastian@SSpaeth.de"
70
71         notmuch search subject:"my favorite things"
72
73 See "notmuch help search" for more details.
74
75 You can also use "notmuch show" with any of the thread IDs resulting
76 from a search. Finally, you may want to explore using a more sophisticated
77 interface to notmuch such as the emacs interface implemented in notmuch.el
78 or any other interface described at http://notmuchmail.org
79
80 And don't forget to run "notmuch new" whenever new mail arrives.
81
82 Have fun, and may your inbox never have much mail.
83 """
84 #-------------------------------------------------------------------------
85 if __name__ == '__main__':
86
87    # Handle command line options
88    # No option 
89    if len(sys.argv) == 1:
90       print USAGE
91
92    elif sys.argv[1] == 'setup':
93        """ Interactively setup notmuch for first use. """
94        print "Not implemented."
95
96    elif sys.argv[1] == 'help':
97        if len(sys.argv) == 2: print HELPTEXT
98        else: print "Not implemented"
99
100    elif sys.argv[1] == 'new':
101        #TODO: handle --verbose
102        print "Not implemented."
103    else:
104        # unknown command
105        print "Error: Unknown command '%s' (see \"notmuch help\")" % sys.argv[1]
106
107
108    #TODO: implement
109    """
110 search  [options...] <search-terms> [...]
111
112         Search for messages matching the given search terms.
113
114 show    <search-terms> [...]
115
116         Show all messages matching the search terms.
117
118 count   <search-terms> [...]
119
120         Count messages matching the search terms.
121
122 reply   [options...] <search-terms> [...]
123
124         Construct a reply template for a set of messages.
125
126 tag     +<tag>|-<tag> [...] [--] <search-terms> [...]
127
128         Add/remove tags for all messages matching the search terms.
129
130 dump    [<filename>]
131
132         Create a plain-text dump of the tags for each message.
133
134 restore <filename>
135         search-tags     [<search-terms> [...] ]
136
137                 List all tags found in the database or matching messages.
138    """