Skip to content

feat: make --user optional in password set/clear, use imap.user from config #27

Description

@KHolodilin

Description

Make --user optional for password set and password clear. When --user is omitted, use imap.user from the configuration file (config.yaml).

Current behavior:

# Required
python -m email_processor password set --user your_email@example.com
python -m email_processor password clear --user your_email@example.com

Desired behavior:

# With config containing imap.user
python -m email_processor password set
python -m email_processor password clear

# Explicit --user still overrides
python -m email_processor password set --user other@example.com

Tasks

  • Make --user optional in CLI args for password set and password clear (required=False)
  • When --user is not provided, load config (--config path) and use imap.user
  • If neither --user nor imap.user is available, error: e.g. --user is required or set imap.user in config
  • Update __main__ flow: ensure config is loaded before password commands when resolving user
  • Update tests (unit + integration) for both --user and config fallback
  • Update README / Quick Start if password set examples assume --user is mandatory

Acceptance Criteria

  • password set and password clear work without --user when imap.user is in config
  • --user overrides imap.user when both are present
  • Clear error when neither is available
  • All tests pass, pre-commit passes
  • Documentation updated

Notes

  • Config is already loaded for commands that use it; password commands run in a code path where config can be loaded (or we load it only when --user is missing to avoid breaking password clear without config).
  • Consider same fallback for password clear for consistency.

Implementation: PR #28

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions