diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 499eeff6a..6860617b7 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1507,8 +1507,9 @@ config_cmd.parser.add_option( help='include the default configuration' ) config_cmd.parser.add_option( - '-r', '--redact', action='store_true', - help='redact sensitive fields' + '-c', '--clear', action='store_false', + dest='redact', default=True, + help='do not redact sensitive fields' ) config_cmd.func = config_func default_commands.append(config_cmd) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3441ee7c6..ea3d8d821 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -66,9 +66,9 @@ Features: flexible attribute `data_source` of an Item/Album. :bug:`1311` * :doc:`/plugins/permissions`: Now handles also the permissions of the directories. :bug:`1308` :bug:`1324` -* In the :ref:`config-cmd` command, a new option ``-r/--redact`` will - automatically redact sensitive values (e.g., passwords) when printing the - config. :bug:`1376` +* In the :ref:`config-cmd` command, the output is now redacted by default. + Sensitive information like passwords and API keys is not included. The new + ``--clear`` option disables redaction. :bug:`1376` * :doc:`/plugins/ftintitle`: You can now configure the format that the plugin uses to add the artist to the title. Thanks to :user:`amishb`. :bug:`1377` diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 40b19f02b..8923a6a5c 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -340,7 +340,7 @@ config `````` :: - beet config [-pdr] + beet config [-pdc] beet config -e Show or edit the user configuration. This command does one of three things: @@ -351,9 +351,8 @@ Show or edit the user configuration. This command does one of three things: * The ``--path`` option instead shows the path to your configuration file. This can be combined with the ``--default`` flag to show where beets keeps its internal defaults. -* The ``--redact`` option will automatically mask sensitive values (e.g., - passwords) when printing the configuration. This makes it easier to - copy/paste your config when reporting bugs. +* By default, sensitive information like passwords is removed when dumping the + configuration. The ``--clear`` option includes this sensitive data. * With the ``--edit`` option, beets attempts to open your config file for editing. It first tries the ``$EDITOR`` environment variable and then a fallback option depending on your platform: ``open`` on OS X, ``xdg-open`` diff --git a/test/test_config_command.py b/test/test_config_command.py index f1e1b375f..18463cb2a 100644 --- a/test/test_config_command.py +++ b/test/test_config_command.py @@ -42,14 +42,14 @@ class ConfigCommandTest(unittest.TestCase, TestHelper): def test_show_user_config(self): with capture_stdout() as output: - self.run_command('config') + self.run_command('config', '-c') output = yaml.load(output.getvalue()) self.assertEqual(output['option'], 'value') self.assertEqual(output['password'], 'password_value') def test_show_user_config_with_defaults(self): with capture_stdout() as output: - self.run_command('config', '-d') + self.run_command('config', '-dc') output = yaml.load(output.getvalue()) self.assertEqual(output['option'], 'value') self.assertEqual(output['password'], 'password_value') @@ -65,14 +65,14 @@ class ConfigCommandTest(unittest.TestCase, TestHelper): def test_show_redacted_user_config(self): with capture_stdout() as output: - self.run_command('config', '-r') + self.run_command('config') output = yaml.load(output.getvalue()) self.assertEqual(output['option'], 'value') self.assertEqual(output['password'], 'REDACTED') def test_show_redacted_user_config_with_defaults(self): with capture_stdout() as output: - self.run_command('config', '-rd') + self.run_command('config', '-d') output = yaml.load(output.getvalue()) self.assertEqual(output['option'], 'value') self.assertEqual(output['password'], 'REDACTED')