Skip to content

Fix --offline flag: it is parsed but currently a no-op #11

Description

@oksaumya

Summary

analyze accepts an --offline flag, but cmd/optiqor/main.go comments it as "always true in Phase 1" and never reads its value. This is confusing: users who pass --offline expect a guarantee that no network calls will be made, but they get no signal that the flag did anything.

Steps to reproduce

optiqor analyze ./my-chart --offline
# No error, but the flag has no observable effect or documented guarantee.

What to do

  1. Locate the --offline binding in cmd/optiqor/main.go (near the analyze command flags).
  2. Delete the "always true in Phase 1" comment and actually read the flag.
  3. If --offline is set (or OPTIQOR_OFFLINE=1 env var), and --share is also set, print a warning:
    warning: --share is ignored in --offline mode
    
    and skip the upload without exiting non-zero.
  4. Document the flag clearly in --help.

Acceptance criteria

  • --offline --share prints a warning and skips the upload instead of silently uploading.
  • OPTIQOR_OFFLINE=1 is honoured identically to --offline.
  • The flag is documented in optiqor analyze --help.
  • make lint test passes.

Why this is a good first issue

  • Isolated change: only cmd/optiqor/main.go and the --share upload path in internal/share/share.go.
  • Good entry point to understanding how flags flow through the CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions