Skip to content

[cli-consistency] Inconsistent flag naming: --workflows-dir vs --dir across commands #7502

@github-actions

Description

@github-actions

Issue Description

Commands: Multiple commands (compile, add, update)
Type: Flag naming inconsistency
Priority: High

Current State

The codebase has inconsistent flag names for specifying the workflow directory:

compile command (cmd/gh-aw/main.go, lines 460-462):

compileCmd.Flags().String("dir", "", "Workflow directory (default: .github/workflows)")
compileCmd.Flags().String("workflows-dir", "", "Deprecated: use --dir instead")
_ = compileCmd.Flags().MarkDeprecated("workflows-dir", "use --dir instead")

add command (pkg/cli/add_command.go, line 64):

workflowDir, _ := cmd.Flags().GetString("dir")

update command (pkg/cli/update_command.go, line 70):

workflowDir, _ := cmd.Flags().GetString("dir")

Issue

While the deprecation is properly handled in the compile command, the help text and documentation could be confusing to users who see both --dir and the deprecated --workflows-dir mentioned.

Additionally, the --dir flag description says "Workflow directory" but this is less descriptive than it could be. Users might expect it to work with any directory, but it's specifically for the workflows directory.

Suggested Fix

  1. Keep the current deprecation - The deprecation handling is correct
  2. Improve the --dir flag description for clarity:
compileCmd.Flags().String("dir", "", "Workflows directory (default: .github/workflows)")
  1. Document the deprecation in the Long help text:
The --dir flag specifies the workflows directory (default: .github/workflows).
Note: --workflows-dir is deprecated, use --dir instead.

This makes the migration path clear while maintaining backward compatibility.

AI generated by CLI Consistency Checker

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions