|
17 | 17 | import sys |
18 | 18 |
|
19 | 19 | from newsroom.cycle import BRIEF_PATH, CycleState, prepare, publish |
| 20 | +from newsroom.publish import DEFAULT_AUTHOR, SUPPORTED_AUTHORS |
20 | 21 |
|
21 | 22 |
|
22 | 23 | def _emit(payload: dict, *, ok: bool) -> int: |
@@ -57,7 +58,7 @@ def _publish(args: argparse.Namespace) -> int: |
57 | 58 | if isinstance(payload, dict) and "__error__" in payload: |
58 | 59 | return _emit({"ok": False, "problems": [payload["__error__"]]}, ok=False) |
59 | 60 |
|
60 | | - report = publish(payload, build=not args.no_build, do_commit=not args.no_commit) |
| 61 | + report = publish(payload, build=not args.no_build, do_commit=not args.no_commit, author=args.author) |
61 | 62 |
|
62 | 63 | return _emit( |
63 | 64 | { |
@@ -105,10 +106,11 @@ def build_parser() -> argparse.ArgumentParser: |
105 | 106 | ) |
106 | 107 | prepare_cmd.set_defaults(func=_prepare) |
107 | 108 |
|
108 | | - publish_cmd = sub.add_parser("publish", help="Asteria yanıtını yayına taşır") |
| 109 | + publish_cmd = sub.add_parser("publish", help="Editoryal operatör yanıtını yayına taşır") |
109 | 110 | group = publish_cmd.add_mutually_exclusive_group(required=True) |
110 | 111 | group.add_argument("--response", help="Yanıt JSON dosyası") |
111 | 112 | group.add_argument("--stdin", action="store_true", help="Yanıtı stdin'den oku") |
| 113 | + publish_cmd.add_argument("--author", choices=SUPPORTED_AUTHORS, default=DEFAULT_AUTHOR, help=f"Yayın imzası (varsayılan: {DEFAULT_AUTHOR})") |
112 | 114 | publish_cmd.add_argument("--no-build", action="store_true", help="Astro build adımını atla") |
113 | 115 | publish_cmd.add_argument("--no-commit", action="store_true", help="Commit adımını atla") |
114 | 116 | publish_cmd.set_defaults(func=_publish) |
|
0 commit comments