Skip to content

No way to check which club is currently in use #173

Description

@Sootopolis

current_club is write-only from the CLI's perspective — nothing surfaces it.

  • use-club takes a required positional (CliCommand.scala:195-198), so a bare ccas use-club is Missing argument <slug>., exit 2.
  • ccas club list prints the managed set with no current marker — printManagedClubs doesn't even take currentClub (Dispatcher.scala:221-225), despite runCommand receiving it (Dispatcher.scala:93).
  • ClubResolver.single consumes it silently, a pure orElse with no echo (ClubResolver.scala:22-26). It is named only in the error shown when it is absent.
  • ccas config get current_club says error: current_club is not set. That is correct, not a bug: ccas config owns the server-bootstrap ccas.env by contract (ConfigCommand.scala:10-18), while current_club lives in the CLI-client config.conf. But ccas config path prints ccas.env, so the user can't even discover which file to cat.

The only way to see the effective club today is to run a command with real side effects (submit a job, or a blacklist mutation).

Proposal: make use-club's slug optional and print on absent. cfg.currentClub is already loaded at Main.scala:31 and in scope at the dispatch site, currently discarded — no new I/O.

  1. CliCommand.scala:196 -> .atMost(1).map(_.headOption) (pattern already used at :238-240)
  2. CliCommand.scala:42 -> Use(slug: Option[String])
  3. Main.scala:65 -> pass cfg.currentClub; None prints the slug, or errors exit 2 when unset

Precedent: git branch, kubectl config current-context, nvm current.

Not ccas club current — that puts an offline local read inside an all-server group.

Secondary: mark the current club in club list output, and teach ccas config path to print both files, labelled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCLI binary (subcommands, completions, config, packaging)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions