headscale icon indicating copy to clipboard operation
headscale copied to clipboard

Standardize user identification flags across CLI commands - fix for #2631

Open tevinflores opened this issue 7 months ago • 1 comments

This PR replaces inconsistent -u/--user arguments with the standard --identifier/--name flags for user identification. Previously, some commands used --user to accept either a user ID (uint) or username (string), creating confusion and inconsistent behavior. This change provides a more explicit and predictable interface for specifying users throughout the CLI.

  • [x] have read the CONTRIBUTING.md file
  • [x] raised a GitHub issue or discussed it on the projects chat beforehand
  • [x] added unit tests
  • [x] added integration tests
  • [ ] updated documentation if #needed
  • [ ] updated CHANGELOG.md

Issue ref: #2631

tevinflores avatar May 29 '25 19:05 tevinflores

Pull Request Revisions

RevisionDescription
r2
CLI flags renamed and refactoredRenamed CLI flags across multiple commands, changing from --name to --user and --identifier to --node-id, with associated logic updates
r1
Refactored CLI user identification flagsIntroduced a new helper function findSingleUser and standardized user identification flags across multiple CLI commands, replacing deprecated namespace flags with consistent username and ID flags.

☑️ AI review skipped for r2
Help React with emojis to give feedback on AI-generated reviews:
  • 👍 means the feedback was helpful and actionable
  • 👎 means the feedback was incorrect or unhelpful
💬 Replying to feedback with a comment helps us improve the system. Your input also contributes to shaping future interactions with the AI reviewer.

We'd love to hear from you—reach out anytime at [email protected].

ghost avatar May 29 '25 19:05 ghost