[lint:go] golangci-lint has version 2.11.4 built with go1.26.1 from 8f3b0c7e on 2026-03-22T17:35:14Z · Entire

Proposed Changes for git-sync

Overview

The discussion revolves around enhancing the command-line interface (CLI) experience for git-sync. The primary focus is on structuring help commands to provide clearer usage instructions for users.

Current Implementation Issues

  1. Usage Block Structure
    The current implementation using the standard library flag package only produces a single usage block, making it harder for users to find help for specific subcommands.

  2. Error Handling
    All error scenarios return the same usage error, leading to confusion for users.

Proposed Solutions

  1. Migration to Cobra Package

    • Transitioning to the Cobra package which offers built-in support for subcommand help.
    • Each subcommand automatically receives its own --help option.
    • Provides a root command that can display usage more cleanly when invoked without parameters, improving usability.
  2. Refactor Existing Command Logic

    • Replace the large usageError block with concise messages based on the invoked command.
    • Maintain backward compatibility for existing command behavior while providing enhancements.

Recommendations

Implementation Details

Behavioral Changes

Testing and Maintenance

Note: All relevant flags and behaviors have been preserved to ensure a seamless transition for users.