From e6972bcbb9e01968d9a815a7d894ee0510badc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Sat, 23 Jun 2018 15:09:39 +0200 Subject: [PATCH] api: Add extra arguments to get-messages example. --- zulip/zulip/examples/get-messages | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/zulip/zulip/examples/get-messages b/zulip/zulip/examples/get-messages index ab51fb9..8ea071d 100755 --- a/zulip/zulip/examples/get-messages +++ b/zulip/zulip/examples/get-messages @@ -5,11 +5,15 @@ import argparse import zulip -usage = """ get-messages (--anchor | --use-first-unread-anchor) \ ---num-before --num-after [--narrow ] +usage = """get-messages (--anchor | --use-first-unread-anchor) \\ + --num-before --num-after \\ + [--narrow --client-gravatar --apply-markdown] -Example: get-messages --anchor=42 --num-before=3 --num-after=14 --narrow=\ -'[{"operator": "sender", "operand": "iago@zulip.com"}]' + +Example: get-messages --anchor=42 --num-before=3 --num-after=14 \\ + --narrow='[{"operator": "sender", "operand": "iago@zulip.com"}]' +Example: get-messages --use-first-unread-anchor --num-before=5 \\ + --num-after=0 --apply-markdown --client-gravatar """ @@ -18,6 +22,8 @@ parser.add_argument('--anchor', type=int) parser.add_argument('--use-first-unread-anchor', action='store_true') parser.add_argument('--num-before', type=int, required=True) parser.add_argument('--num-after', type=int, required=True) +parser.add_argument('--client-gravatar', action='store_true') +parser.add_argument('--apply-markdown', action='store_true') parser.add_argument('--narrow') options = parser.parse_args() @@ -29,4 +35,6 @@ print(client.get_messages({ 'num_before': options.num_before, 'num_after': options.num_after, 'narrow': options.narrow, + 'client_gravatar': options.client_gravatar, + 'apply_markdown': options.apply_markdown }))