From 309ae84336fd1d0262cad49adef7ce3dc72c531c Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 6 Nov 2020 16:17:15 -0800 Subject: [PATCH] '-f' must now always be specified as '--fmt', refs #194 --- docs/cli.rst | 2 +- sqlite_utils/cli.py | 1 - tests/test_cli.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 166eea1a2..90440398b 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -162,7 +162,7 @@ You can use the ``--table`` option (or ``-t`` shortcut) to output query results 1 4 Cleo 2 2 Pancakes -You can use the ``--fmt`` (or ``-f``) option to specify different table formats, for example ``rst`` for reStructuredText:: +You can use the ``--fmt`` option to specify different table formats, for example ``rst`` for reStructuredText:: $ sqlite-utils dogs.db "select * from dogs" --table --fmt rst ==== ===== ======== diff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py index 18247ebfd..e75d514cb 100644 --- a/sqlite_utils/cli.py +++ b/sqlite_utils/cli.py @@ -50,7 +50,6 @@ def output_options(fn): click.option("--no-headers", is_flag=True, help="Omit CSV headers"), click.option("-t", "--table", is_flag=True, help="Output as a table"), click.option( - "-f", "--fmt", help="Table format - one of {}".format( ", ".join(tabulate.tabulate_formats) diff --git a/tests/test_cli.py b/tests/test_cli.py index db31121a3..00efdf131 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -149,7 +149,7 @@ def test_output_table(db_path, fmt, expected): for i in range(4) ] ) - result = CliRunner().invoke(cli.cli, ["rows", db_path, "rows", "-t", "-f", fmt]) + result = CliRunner().invoke(cli.cli, ["rows", db_path, "rows", "-t", "--fmt", fmt]) assert 0 == result.exit_code assert expected == result.output.strip()