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