Remove --quiet flag

This commit is contained in:
Ivan Habunek 2023-12-26 10:35:41 +01:00
parent 44b6f9fcf4
commit eeb90dc21c
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
4 changed files with 13 additions and 13 deletions

View File

@ -3,7 +3,7 @@ Changelog
<!-- Do not edit. This file is automatically generated from changelog.yaml.-->
**0.40.0 (TBA)**
**0.40.0 (SOON)**
This release includes a rather extensive change to use the Click library
(https://click.palletsprojects.com/) for creating the command line interface.
@ -13,8 +13,9 @@ mostly preserved, except for cases noted below. Please report any issues.
* BREAKING: Remove deprecated `--disable-https` option for `login` and
`login_cli`, pass the base URL instead
* BREAKING: Options `--debug`, `--color`, `--quiet` must be specified after
`toot` but before the command
* BREAKING: Options `--debug` and `--color` must be specified after `toot` but
before the command
* BREAKING: Option `--quiet` has been removed. Redirect output instead.
* Add passing parameters via environment variables, see:
https://toot.bezdomni.net/environment_variables.html
* Add shell completion, see: https://toot.bezdomni.net/shell_completion.html

View File

@ -9,7 +9,8 @@
Please report any issues.
changes:
- "BREAKING: Remove deprecated `--disable-https` option for `login` and `login_cli`, pass the base URL instead"
- "BREAKING: Options `--debug`, `--color`, `--quiet` must be specified after `toot` but before the command"
- "BREAKING: Options `--debug` and `--color` must be specified after `toot` but before the command"
- "BREAKING: Option `--quiet` has been removed. Redirect output instead."
- "Add passing parameters via environment variables, see: https://toot.bezdomni.net/environment_variables.html"
- "Add shell completion, see: https://toot.bezdomni.net/shell_completion.html"
- "Add `tags info`, `tags featured`, `tags feature`, and `tags unfeature` commands"

View File

@ -3,7 +3,7 @@ Changelog
<!-- Do not edit. This file is automatically generated from changelog.yaml.-->
**0.40.0 (TBA)**
**0.40.0 (SOON)**
This release includes a rather extensive change to use the Click library
(https://click.palletsprojects.com/) for creating the command line interface.
@ -13,8 +13,9 @@ mostly preserved, except for cases noted below. Please report any issues.
* BREAKING: Remove deprecated `--disable-https` option for `login` and
`login_cli`, pass the base URL instead
* BREAKING: Options `--debug`, `--color`, `--quiet` must be specified after
`toot` but before the command
* BREAKING: Options `--debug` and `--color` must be specified after `toot` but
before the command
* BREAKING: Option `--quiet` has been removed. Redirect output instead.
* Add passing parameters via environment variables, see:
https://toot.bezdomni.net/environment_variables.html
* Add shell completion, see: https://toot.bezdomni.net/shell_completion.html

View File

@ -78,14 +78,12 @@ class Context(t.NamedTuple):
user: t.Optional[User] = None
color: bool = False
debug: bool = False
quiet: bool = False
class TootObj(t.NamedTuple):
"""Data to add to Click context"""
color: bool = True
debug: bool = False
quiet: bool = False
# Pass a context for testing purposes
test_ctx: t.Optional[Context] = None
@ -111,7 +109,7 @@ def get_context() -> Context:
if not user or not app:
raise click.ClickException("This command requires you to be logged in.")
return Context(app, user, obj.color, obj.debug, obj.quiet)
return Context(app, user, obj.color, obj.debug)
json_option = click.option(
@ -126,12 +124,11 @@ json_option = click.option(
@click.option("-w", "--max-width", type=int, default=80, help="Maximum width for content rendered by toot")
@click.option("--debug/--no-debug", default=False, help="Log debug info to stderr")
@click.option("--color/--no-color", default=sys.stdout.isatty(), help="Use ANSI color in output")
@click.option("--quiet/--no-quiet", default=False, help="Don't print anything to stdout")
@click.version_option(__version__, message="%(prog)s v%(version)s")
@click.pass_context
def cli(ctx: click.Context, max_width: int, color: bool, debug: bool, quiet: bool):
def cli(ctx: click.Context, max_width: int, color: bool, debug: bool):
"""Toot is a Mastodon CLI"""
ctx.obj = TootObj(color, debug, quiet)
ctx.obj = TootObj(color, debug)
ctx.color = color
ctx.max_content_width = max_width