mirror of https://github.com/Calamitous/iris.git
Compare commits
8 Commits
b13ac5fd03
...
08694c1403
Author | SHA1 | Date |
---|---|---|
Eric B. Budd | 08694c1403 | |
Eric B. Budd | 0462ada0a0 | |
Eric B. Budd | 28db4d3e20 | |
Eric B. Budd | 9fd530c41c | |
Eric B. Budd | b3d3640f97 | |
Eric B. Budd | 7c3fad429e | |
Amarpreet Minhas | 95e77eb1b1 | |
Eric B. Budd | ce84f6ed10 |
61
README.md
61
README.md
|
@ -36,11 +36,11 @@ Iris has a readline interface that can be used to navigate the message corpus.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
%> iris
|
%> iris
|
||||||
Welcome to Iris v. 1.0.11. Type "help" for a list of commands.; Ctrl-D or 'quit' to leave.
|
Welcome to Iris v. 1.0.12. Type "help" for a list of commands.; Ctrl-D or 'quit' to leave.
|
||||||
|
|
||||||
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
||||||
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
||||||
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for imp...
|
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for a...
|
||||||
|
|
||||||
jimmy_foo@ctrl-c.club>
|
jimmy_foo@ctrl-c.club>
|
||||||
```
|
```
|
||||||
|
@ -50,11 +50,13 @@ jimmy_foo@ctrl-c.club>
|
||||||
* [[t]opics](#topics)
|
* [[t]opics](#topics)
|
||||||
* [[u]nread](#unread)
|
* [[u]nread](#unread)
|
||||||
* [Display topic](#display-topic)
|
* [Display topic](#display-topic)
|
||||||
|
* [[n]ext](#next)
|
||||||
* [[c]ompose](#compose)
|
* [[c]ompose](#compose)
|
||||||
* [[r]eply](#reply)
|
* [[r]eply](#reply)
|
||||||
* [[e]dit](#edit)
|
* [[e]dit](#edit)
|
||||||
* [[d]elete and un[d]elete](#delete)
|
* [[d]elete and un[d]elete](#delete)
|
||||||
* [[m]ark_read](#mark_read)
|
* [[m]ark_read](#mark_read)
|
||||||
|
* [mark_all_read](#mark_all_read)
|
||||||
* [[f]reshen](#freshen)
|
* [[f]reshen](#freshen)
|
||||||
* [reset OR clear](#reset-or-clear)
|
* [reset OR clear](#reset-or-clear)
|
||||||
* [[i]nfo](#info)
|
* [[i]nfo](#info)
|
||||||
|
@ -72,7 +74,7 @@ jimmy_foo@ctrl-c.club> topics
|
||||||
|
|
||||||
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
||||||
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
||||||
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for i...
|
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for a...
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -93,7 +95,7 @@ This outputs a list of top-level topics that have not been read, or have unread
|
||||||
jimmy_foo@ctrl-c.club> unread
|
jimmy_foo@ctrl-c.club> unread
|
||||||
|
|
||||||
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
||||||
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for i...
|
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for a...
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -110,7 +112,7 @@ jimmy_foo@ctrl-c.club> topics
|
||||||
|
|
||||||
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
||||||
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
||||||
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for i...
|
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for a...
|
||||||
|
|
||||||
jimmy_foo@ctrl-c.club> 1
|
jimmy_foo@ctrl-c.club> 1
|
||||||
*** [1] On 2018-01-24T05:49:53Z, jimmy_foo@ctrl-c.club posted...-----------------
|
*** [1] On 2018-01-24T05:49:53Z, jimmy_foo@ctrl-c.club posted...-----------------
|
||||||
|
@ -126,6 +128,32 @@ It's good to see everyone here!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### [n]ext
|
||||||
|
`next, n - Read the next unread topic`
|
||||||
|
|
||||||
|
This command displays the first topic which is unread or has unread replies.
|
||||||
|
```
|
||||||
|
jimmy_foo@ctrl-c.club> topics
|
||||||
|
|
||||||
|
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
||||||
|
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
||||||
|
| 2 | 1 | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for a...
|
||||||
|
|
||||||
|
jimmy_foo@ctrl-c.club> next
|
||||||
|
*** [2] On 2018-01-24T16:13:05Z, jerry_berry@ctrl-c.club posted...---------------
|
||||||
|
Suggestions for a tilde home?
|
||||||
|
|
||||||
|
I'm trying to decide on a new place in the tildeverse to call home. Any ideas?
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
| === [M4] On 2018-01-30T22:50:38Z, jimmy_foo@ctrl-c.club replied...-----------
|
||||||
|
| Have you considered https://ctrl-c.club?
|
||||||
|
| -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### [c]ompose
|
### [c]ompose
|
||||||
`compose, c - Add a new topic`
|
`compose, c - Add a new topic`
|
||||||
|
|
||||||
|
@ -149,7 +177,7 @@ jimmy_foo@ctrl-c.club~> topics
|
||||||
|
|
||||||
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
| ID | U | TIMESTAMP | AUTHOR | TITLE
|
||||||
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
| 1 | | 2018-01-24T05:49:53Z | jimmy_foo@ctrl-c.club | Welcome!
|
||||||
| 2 | | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for i...
|
| 2 | | 2018-01-24T16:13:05Z | jerry_berry@ctrl-c.club | Suggestions for a...
|
||||||
| 3 | 1 | 2018-01-23T00:13:44Z | jimmy_foo@ctrl-c.club | How do I spoo the...
|
| 3 | 1 | 2018-01-23T00:13:44Z | jimmy_foo@ctrl-c.club | How do I spoo the...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -313,6 +341,13 @@ Mark a topic and all its replies as read without displaying them.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### [m]ark_all_read
|
||||||
|
`mark_all_read - Mark all messages as read`
|
||||||
|
|
||||||
|
Marks all topics and their replies as read without displaying them.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### [f]reshen
|
### [f]reshen
|
||||||
`freshen, f - Reload to get any new messages`
|
`freshen, f - Reload to get any new messages`
|
||||||
|
|
||||||
|
@ -335,7 +370,7 @@ This outputs the current version of Iris, along with messsage, topic, and author
|
||||||
```bash
|
```bash
|
||||||
jennie_minnie@ctrl-c.club~> info
|
jennie_minnie@ctrl-c.club~> info
|
||||||
|
|
||||||
Iris 1.0.11
|
Iris 1.0.12
|
||||||
13 topics, 0 unread.
|
13 topics, 0 unread.
|
||||||
50 messages, 0 unread.
|
50 messages, 0 unread.
|
||||||
10 authors.
|
10 authors.
|
||||||
|
@ -355,6 +390,7 @@ There are a few options you can pass in from the command-line:
|
||||||
* [--version, -v](#--version-v)
|
* [--version, -v](#--version-v)
|
||||||
* [--stats, -s](#--stats-s)
|
* [--stats, -s](#--stats-s)
|
||||||
* [--interactive, -i](#--interactive-i)
|
* [--interactive, -i](#--interactive-i)
|
||||||
|
* [--mark-all-read](#--mark-all-read)
|
||||||
* [--dump, -d](#--dump-d)
|
* [--dump, -d](#--dump-d)
|
||||||
* [--help, -h](#--help-h)
|
* [--help, -h](#--help-h)
|
||||||
* [--debug](#--debug)
|
* [--debug](#--debug)
|
||||||
|
@ -368,7 +404,7 @@ iris --version
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Iris 1.0.11
|
Iris 1.0.12
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -384,7 +420,7 @@ iris --stats
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Iris 1.0.11
|
Iris 1.0.12
|
||||||
13 topics, 0 unread.
|
13 topics, 0 unread.
|
||||||
50 messages, 0 unread.
|
50 messages, 0 unread.
|
||||||
10 authors.
|
10 authors.
|
||||||
|
@ -400,6 +436,13 @@ This is the mode that Iris enters if no options are passed on the command-line.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
### --mark-all-read
|
||||||
|
|
||||||
|
This command simply marks every message as read in Iris. It's a quick way to get to "Irisbox Zero".
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### --dump/-d
|
### --dump/-d
|
||||||
|
|
||||||
This reads the entire message corpus and outputs it as a stream of JSON data, suitable for piping into a backup file, `jq` parser, or similar.
|
This reads the entire message corpus and outputs it as a stream of JSON data, suitable for piping into a backup file, `jq` parser, or similar.
|
||||||
|
|
17
TODO.md
17
TODO.md
|
@ -10,22 +10,21 @@
|
||||||
* Flesh out technical sections
|
* Flesh out technical sections
|
||||||
|
|
||||||
### Bugs
|
### Bugs
|
||||||
|
* Replying implicitly to 24 replied to 6 instead-- remove implicit reply?
|
||||||
* Is `Time.now.utc.iso8601` working as expected?
|
* Is `Time.now.utc.iso8601` working as expected?
|
||||||
* Fix bug when people are posting from different time zones
|
* Fix bug when people are posting from different time zones
|
||||||
* Fix message ordering when editing/deleting multiple messages
|
* Fix message ordering when editing/deleting multiple messages
|
||||||
* Exclude user''s own messages from "unread" count
|
|
||||||
* Replying implicitly to 24 replied to 6 instead
|
|
||||||
* Gracefully handle attempt to "r 1 message"
|
* Gracefully handle attempt to "r 1 message"
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
* Add pagination/less for long message lists
|
* Add "unread" marker to topic replies
|
||||||
* https://github.com/Calamitous/iris/issues/1
|
|
||||||
* Allow shelling out to editor for message editing
|
* Allow shelling out to editor for message editing
|
||||||
* https://github.com/Calamitous/iris/issues/2
|
* https://github.com/Calamitous/iris/issues/2
|
||||||
|
* Add pagination/less for long message lists
|
||||||
|
* https://github.com/Calamitous/iris/issues/1
|
||||||
* Add local timezone rendering
|
* Add local timezone rendering
|
||||||
* Add "Mark all read" option
|
|
||||||
* Add option to mark all messages in a thread as read
|
|
||||||
* CLI option to show response count to threads the user authored
|
* CLI option to show response count to threads the user authored
|
||||||
|
* Search/regex function to find all messages
|
||||||
|
|
||||||
### Tech debt
|
### Tech debt
|
||||||
* Flesh out tests
|
* Flesh out tests
|
||||||
|
@ -69,6 +68,12 @@
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.0.12
|
||||||
|
* Add Asara's "mark all read" functionality
|
||||||
|
* Fix(?) bug with handling broken UTF-8 characters
|
||||||
|
* Add feature to read the next unread topic ("next")
|
||||||
|
* Exclude user''s own messages from "unread" count
|
||||||
|
|
||||||
## 1.0.11
|
## 1.0.11
|
||||||
* Speed up the topic listing significantly
|
* Speed up the topic listing significantly
|
||||||
* Add 'unread' (short form 'u') to only list topics with unread messages
|
* Add 'unread' (short form 'u') to only list topics with unread messages
|
||||||
|
|
117
iris.rb
117
iris.rb
|
@ -8,7 +8,7 @@ require 'time'
|
||||||
# require 'pry' # Only needed for debugging
|
# require 'pry' # Only needed for debugging
|
||||||
|
|
||||||
class Config
|
class Config
|
||||||
VERSION = '1.0.11'
|
VERSION = '1.0.12'
|
||||||
MESSAGE_FILE = "#{ENV['HOME']}/.iris.messages"
|
MESSAGE_FILE = "#{ENV['HOME']}/.iris.messages"
|
||||||
HISTORY_FILE = "#{ENV['HOME']}/.iris.history"
|
HISTORY_FILE = "#{ENV['HOME']}/.iris.history"
|
||||||
IRIS_SCRIPT = __FILE__
|
IRIS_SCRIPT = __FILE__
|
||||||
|
@ -17,10 +17,11 @@ class Config
|
||||||
HOSTNAME = `hostname -d`.chomp
|
HOSTNAME = `hostname -d`.chomp
|
||||||
AUTHOR = "#{USER}@#{HOSTNAME}"
|
AUTHOR = "#{USER}@#{HOSTNAME}"
|
||||||
OPTIONS = %w[
|
OPTIONS = %w[
|
||||||
--dump
|
|
||||||
--debug
|
--debug
|
||||||
|
--dump
|
||||||
--help
|
--help
|
||||||
--interactive
|
--interactive
|
||||||
|
--mark-all-read
|
||||||
--stats
|
--stats
|
||||||
--test-file
|
--test-file
|
||||||
--version
|
--version
|
||||||
|
@ -28,11 +29,12 @@ class Config
|
||||||
-f
|
-f
|
||||||
-h
|
-h
|
||||||
-i
|
-i
|
||||||
|
-p
|
||||||
-s
|
-s
|
||||||
-v
|
-v
|
||||||
]
|
]
|
||||||
INTERACTIVE_OPTIONS = %w[-i --interactive]
|
INTERACTIVE_OPTIONS = %w[-i --interactive]
|
||||||
NONINTERACTIVE_OPTIONS = %w[-d --dump -h --help -v --version -s --stats]
|
NONINTERACTIVE_OPTIONS = %w[-d --dump -h --help -v --version -s --stats --mark-all-read]
|
||||||
NONFILE_OPTIONS = %w[-h --help -v --version]
|
NONFILE_OPTIONS = %w[-h --help -v --version]
|
||||||
|
|
||||||
@@debug_mode = false
|
@@debug_mode = false
|
||||||
|
@ -230,6 +232,7 @@ class Corpus
|
||||||
@@unread_messages ||= @@corpus
|
@@unread_messages ||= @@corpus
|
||||||
.select { |message| message.show_me? }
|
.select { |message| message.show_me? }
|
||||||
.reject{ |m| @@my_reads.include? m.hash }
|
.reject{ |m| @@my_reads.include? m.hash }
|
||||||
|
.reject{ |m| @@my_corpus.map(&:hash).include? m.hash }
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.unread_message_hashes
|
def self.unread_message_hashes
|
||||||
|
@ -247,6 +250,12 @@ class Corpus
|
||||||
def self.size
|
def self.size
|
||||||
@@corpus.size
|
@@corpus.size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.mark_as_read(hashes)
|
||||||
|
new_reads = (Corpus.read_hashes + hashes).uniq.sort
|
||||||
|
IrisFile.write_read_file(new_reads.to_json)
|
||||||
|
Corpus.load
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class IrisFile
|
class IrisFile
|
||||||
|
@ -643,34 +652,37 @@ class Display
|
||||||
end
|
end
|
||||||
|
|
||||||
class Interface
|
class Interface
|
||||||
ONE_SHOTS = %w{help topics unread compose quit freshen reset_display reply edit delete mark_read info}
|
ONE_SHOTS = %w{ compose delete edit freshen help info mark_all_read mark_read next quit reply reset_display topics unread }
|
||||||
CMD_MAP = {
|
CMD_MAP = {
|
||||||
't' => 'topics',
|
'?' => 'help',
|
||||||
'topics' => 'topics',
|
'c' => 'compose',
|
||||||
'u' => 'unread',
|
'clear' => 'reset_display',
|
||||||
'unread' => 'unread',
|
'compose' => 'compose',
|
||||||
'm' => 'mark_read',
|
'd' => 'delete',
|
||||||
'mark' => 'mark_read',
|
'delete' => 'delete',
|
||||||
'c' => 'compose',
|
'e' => 'edit',
|
||||||
'compose' => 'compose',
|
'edit' => 'edit',
|
||||||
'h' => 'help',
|
'f' => 'freshen',
|
||||||
'?' => 'help',
|
'freshen' => 'freshen',
|
||||||
'help' => 'help',
|
'h' => 'help',
|
||||||
'r' => 'reply',
|
'help' => 'help',
|
||||||
'reply' => 'reply',
|
'i' => 'info',
|
||||||
'e' => 'edit',
|
'info ' => 'info',
|
||||||
'edit' => 'edit',
|
'm' => 'mark_read',
|
||||||
'd' => 'delete',
|
'mark' => 'mark_read',
|
||||||
'delete' => 'delete',
|
'mark_all_read' => 'mark_all_read',
|
||||||
'undelete' => 'delete',
|
'n' => 'next',
|
||||||
'q' => 'quit',
|
'next' => 'next',
|
||||||
'quit' => 'quit',
|
'q' => 'quit',
|
||||||
'freshen' => 'freshen',
|
'quit' => 'quit',
|
||||||
'f' => 'freshen',
|
'r' => 'reply',
|
||||||
'reset' => 'reset_display',
|
'reply' => 'reply',
|
||||||
'clear' => 'reset_display',
|
'reset' => 'reset_display',
|
||||||
'i' => 'info',
|
't' => 'topics',
|
||||||
'info ' => 'info',
|
'topics' => 'topics',
|
||||||
|
'u' => 'unread',
|
||||||
|
'undelete' => 'delete',
|
||||||
|
'unread' => 'unread',
|
||||||
}
|
}
|
||||||
|
|
||||||
def browsing_handler(line)
|
def browsing_handler(line)
|
||||||
|
@ -713,12 +725,39 @@ class Interface
|
||||||
Display.say
|
Display.say
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.mark_all_read
|
||||||
|
Corpus.mark_as_read(Corpus.unread_messages.map(&:hash))
|
||||||
|
end
|
||||||
|
|
||||||
|
def mark_all_read
|
||||||
|
Display.say "Marking all messages as read..."
|
||||||
|
Interface.mark_all_read
|
||||||
|
Display.say "Done!"
|
||||||
|
end
|
||||||
|
|
||||||
def compose
|
def compose
|
||||||
@mode = :composing
|
@mode = :composing
|
||||||
@text_buffer = ''
|
@text_buffer = ''
|
||||||
Display.say 'Writing a new topic. Type a period on a line by itself to end message.'
|
Display.say 'Writing a new topic. Type a period on a line by itself to end message.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def next
|
||||||
|
Display.say
|
||||||
|
|
||||||
|
if Corpus.unread_topics.size == 0
|
||||||
|
Display.say "{gvi You're all caught up! No new topics to read.}"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
message = Corpus.unread_topics.first
|
||||||
|
@reply_topic = message.hash
|
||||||
|
|
||||||
|
Display.say message.to_topic_display
|
||||||
|
Display.say
|
||||||
|
|
||||||
|
Corpus.mark_as_read([message.hash] + message.replies.map(&:hash))
|
||||||
|
end
|
||||||
|
|
||||||
def reply(topic_id = @reply_topic)
|
def reply(topic_id = @reply_topic)
|
||||||
unless topic_id
|
unless topic_id
|
||||||
Display.say "I can't reply to nothing! Include a topic ID or view a topic to reply to."
|
Display.say "I can't reply to nothing! Include a topic ID or view a topic to reply to."
|
||||||
|
@ -787,9 +826,7 @@ class Interface
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
new_reads = (Corpus.read_hashes + [message.hash] + message.replies.map(&:hash)).uniq.sort
|
Corpus.mark_as_read([message.hash] + message.replies.map(&:hash))
|
||||||
IrisFile.write_read_file(new_reads.to_json)
|
|
||||||
Corpus.load
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete(message_id = nil)
|
def delete(message_id = nil)
|
||||||
|
@ -826,6 +863,7 @@ class Interface
|
||||||
end
|
end
|
||||||
|
|
||||||
def replying_handler(line)
|
def replying_handler(line)
|
||||||
|
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
||||||
if line !~ /^\.$/
|
if line !~ /^\.$/
|
||||||
if @text_buffer.empty?
|
if @text_buffer.empty?
|
||||||
@text_buffer = line
|
@text_buffer = line
|
||||||
|
@ -901,9 +939,7 @@ class Interface
|
||||||
Display.say msg.to_topic_display
|
Display.say msg.to_topic_display
|
||||||
Display.say
|
Display.say
|
||||||
|
|
||||||
new_reads = (Corpus.read_hashes + [msg.hash] + msg.replies.map(&:hash)).uniq.sort
|
Corpus.mark_as_read([msg.hash] + msg.replies.map(&:hash))
|
||||||
IrisFile.write_read_file(new_reads.to_json)
|
|
||||||
Corpus.load
|
|
||||||
else
|
else
|
||||||
Display.say 'Could not find a topic with that ID'
|
Display.say 'Could not find a topic with that ID'
|
||||||
end
|
end
|
||||||
|
@ -974,7 +1010,9 @@ class Interface
|
||||||
'topics, t - List all topics',
|
'topics, t - List all topics',
|
||||||
'unread, u - List all topics with unread messages',
|
'unread, u - List all topics with unread messages',
|
||||||
'# (topic id) - Read specified topic',
|
'# (topic id) - Read specified topic',
|
||||||
|
'next, n - Read the next unread topic',
|
||||||
'mark_read #, m # - Mark the associated topic as read',
|
'mark_read #, m # - Mark the associated topic as read',
|
||||||
|
'mark_all_read - Mark all messages as read',
|
||||||
'help, h, ? - Display this text',
|
'help, h, ? - Display this text',
|
||||||
'',
|
'',
|
||||||
'WRITING',
|
'WRITING',
|
||||||
|
@ -1034,6 +1072,7 @@ class CLI
|
||||||
'--version, -v - Display the current version of Iris.',
|
'--version, -v - Display the current version of Iris.',
|
||||||
'--stats, -s - Display Iris version and message stats.',
|
'--stats, -s - Display Iris version and message stats.',
|
||||||
'--interactive, -i - Enter interactive mode (default)',
|
'--interactive, -i - Enter interactive mode (default)',
|
||||||
|
'--mark-all-read - Mark all messages as read.',
|
||||||
'--dump, -d - Dump entire message corpus out.',
|
'--dump, -d - Dump entire message corpus out.',
|
||||||
'--test-file <filename>, -f <filename> - Use the specified test file for messages.',
|
'--test-file <filename>, -f <filename> - Use the specified test file for messages.',
|
||||||
'--debug - Print warnings and debug informtation during use.',
|
'--debug - Print warnings and debug informtation during use.',
|
||||||
|
@ -1063,8 +1102,14 @@ class CLI
|
||||||
exit(0)
|
exit(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (args & %w{--mark-all-read}).any?
|
||||||
|
Interface.mark_all_read
|
||||||
|
exit(0)
|
||||||
|
end
|
||||||
|
|
||||||
Display.say "Unrecognized option(s) #{args.join(', ')}"
|
Display.say "Unrecognized option(s) #{args.join(', ')}"
|
||||||
Display.say "Try -h for help"
|
Display.say "Try -h for help"
|
||||||
|
exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue