Skip to content

Commit

Permalink
'-f' must now always be specified as '--fmt', refs #194
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Nov 7, 2020
1 parent afee15f commit 309ae84
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
==== ===== ========
Expand Down
1 change: 0 additions & 1 deletion sqlite_utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 309ae84

Please sign in to comment.