commit f1883ddcc890657f91e16b7a91b75213773ebbd1
parent 8e0fc0a84466552f3b4363fcabbcd7bc6ef3c2e0
Author: lash <dev@holbrook.no>
Date: Sun, 30 Apr 2023 21:18:19 +0100
Return entry id on creation
Diffstat:
5 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
@@ -1,5 +1,6 @@
* 0.5.5
- Add man page
+ - Return entry uuid on add and entry subcommands
* 0.5.4
- Package for pypi.org
* 0.5.3
diff --git a/feedwarrior/cmd/add.py b/feedwarrior/cmd/add.py
@@ -92,3 +92,4 @@ def execute(config, feed, args):
fa.put(entry.uuid, entry, compress=args.z)
feed.add(entry)
+ return str(entry.uuid)
diff --git a/feedwarrior/cmd/entry.py b/feedwarrior/cmd/entry.py
@@ -48,3 +48,4 @@ def execute(config, feed, args):
fa.put(entry.uuid, entry, compress=args.z)
feed.add(entry)
+ return str(entry.uuid)
diff --git a/feedwarrior/runnable/main.py b/feedwarrior/runnable/main.py
@@ -117,7 +117,9 @@ def main():
logg.debug('found existing datadir {}'.format(config.data_dir))
cmd_mod.check_args(args)
- cmd_mod.execute(config, feed_current, args)
+ r = cmd_mod.execute(config, feed_current, args)
+ if r != None:
+ print(r)
if __name__ == '__main__':
diff --git a/man/man1/feedwarrior.1 b/man/man1/feedwarrior.1
@@ -10,9 +10,7 @@ feedwarrior - Feeds, warrior style
Inspired by
.UR https\://taskwarrior.org
.UE ,
-this project seeks to simplify the maintenance of engineering work logs.
-
-It maintains a collection of logs.
+this project seeks to simplify the creation and maintenance of engineering work logs.
Entries of each individual log has core text content. Additionally, every entry may have any number of file attachments associated with it.
@@ -104,13 +102,30 @@ The \fBfeedwarrior add\fP command enables interactive definition of textual upda
It will open an editor (at the moment hardcoded to \fBvim\fP) to receive the contents.
+.SH DATA STORE
+
+Log entries are stored as email-like MIME Multipart messages, wrapped in a json metadata structure.
+
+Only the default, simple filesystem structure is currently available as storage backend.
+
+
.SH EXAMPLE
.EX
+# create feed
feedwarrior create --alias myfeed
-echo "this is some content" > /tmp/foo.txt
-entry=`feedwarrior entry -s "first update" /tmp/foo.txt`
-feedwarrior attach -e $entry <attachment_file>
+
+¤ add log entry
+ENTRY=`feedwarrior -l myfeed entry -s "first update" /path/to/contents.txt
+
+# attach file to entry
+feedwarrior attach -e $ENTRY <attachment_file>
+
+¤ interactively add log entry contents
+entry=`feedwarrior -l myfeed add -s "second update"
+
+# show current state of feed (chronologically)
+feedwarrior -l myfeed show
.EE
@@ -136,4 +151,4 @@ PGP: 59A844A484AC11253D3A3E9DCDCBD24DD1D0E001
.SH SOURCE CODE
-https://holbrook.no/src/feedwarrior/log.htm ggj
+https://holbrook.no/src/feedwarrior/log.html