diff --git a/DevOps/Options/ConfigOptions.cs b/DevOps/Options/ConfigOptions.cs index 7b0396a..56ae30c 100644 --- a/DevOps/Options/ConfigOptions.cs +++ b/DevOps/Options/ConfigOptions.cs @@ -8,10 +8,10 @@ public class ConfigOptions [Option('o', "org", Required = false, HelpText = "Azure DevOps organization URL (e.g., https://dev.azure.com/myorg).")] public string OrgUrl { get; set; } - [Option('p', "pat", Required = false, HelpText = "Personal Access Token for authentication.")] + [Option('P', "pat", Required = false, HelpText = "Personal Access Token for authentication.")] public string Pat { get; set; } - [Option('l', "login", Required = false, HelpText = "Sign in interactively with Microsoft Entra ID (opens a browser).")] + [Option("login", Required = false, HelpText = "Sign in interactively with Microsoft Entra ID (opens a browser).")] public bool Login { get; set; } [Option("logout", Required = false, HelpText = "Sign out and clear the cached Entra ID token.")] @@ -20,7 +20,7 @@ public class ConfigOptions [Option("tenant", Required = false, HelpText = "Entra ID tenant ID or domain to sign in against (defaults to your home tenant).")] public string Tenant { get; set; } - [Option('P', "project", Required = false, HelpText = "Default project name used when --project is omitted from other commands.")] + [Option('p', "project", Required = false, HelpText = "Default project name used when --project is omitted from other commands.")] public string Project { get; set; } [Option('T', "team", Required = false, HelpText = "Default team name used to resolve the active iteration (defaults to '{Project} Team').")] diff --git a/DevOps/Options/ListOptions.cs b/DevOps/Options/ListOptions.cs index 63e9772..99859a4 100644 --- a/DevOps/Options/ListOptions.cs +++ b/DevOps/Options/ListOptions.cs @@ -5,7 +5,7 @@ namespace DevOps.Options; [Verb("list", HelpText = "List work items.")] public class ListOptions { - [Option('P', "project", Required = false, HelpText = "Project name. Uses default if configured.")] + [Option('p', "project", Required = false, HelpText = "Project name. Uses default if configured.")] public string Project { get; set; } [Option('s', "state", Required = false, HelpText = "Filter by state (e.g., Active, Closed, Resolved).")] @@ -20,7 +20,7 @@ public class ListOptions [Option('q', "query", Required = false, HelpText = "WIQL WHERE clause for advanced filtering.")] public string Query { get; set; } - [Option('p', "parent", Required = false, HelpText = "Filter by parent work item ID.")] + [Option('P', "parent", Required = false, HelpText = "Filter by parent work item ID.")] public int? ParentId { get; set; } [Option("ids", Required = false, HelpText = "Show work item IDs in output.")] diff --git a/DevOps/Options/MineOptions.cs b/DevOps/Options/MineOptions.cs index 14939cc..8a4006f 100644 --- a/DevOps/Options/MineOptions.cs +++ b/DevOps/Options/MineOptions.cs @@ -5,7 +5,7 @@ namespace DevOps.Options; [Verb("mine", HelpText = "List work items assigned to me.")] public class MineOptions { - [Option('P', "project", Required = false, HelpText = "Project name. Uses default if configured.")] + [Option('p', "project", Required = false, HelpText = "Project name. Uses default if configured.")] public string Project { get; set; } [Option('s', "state", Required = false, HelpText = "Filter by state (e.g., Active, Closed, Resolved).")] @@ -17,7 +17,7 @@ public class MineOptions [Option('q', "query", Required = false, HelpText = "Additional WIQL WHERE clause.")] public string Query { get; set; } - [Option('p', "parent", Required = false, HelpText = "Filter by parent work item ID.")] + [Option('P', "parent", Required = false, HelpText = "Filter by parent work item ID.")] public int? ParentId { get; set; } [Option('n', "top", Required = false, Default = 50, HelpText = "Maximum number of work items to fetch (default: 50).")] diff --git a/DevOps/Options/NormalizeOptions.cs b/DevOps/Options/NormalizeOptions.cs index c6851f4..705df0e 100644 --- a/DevOps/Options/NormalizeOptions.cs +++ b/DevOps/Options/NormalizeOptions.cs @@ -5,7 +5,7 @@ namespace DevOps.Options; [Verb("normalize", HelpText = "Normalize work item titles to include the parent type and ID prefix.")] public class NormalizeOptions { - [Option('P', "project", Required = false, HelpText = "Project name. Uses default if configured.")] + [Option('p', "project", Required = false, HelpText = "Project name. Uses default if configured.")] public string Project { get; set; } [Option('s', "state", Required = false, HelpText = "Filter by state (e.g., Active, New).")] @@ -14,12 +14,12 @@ public class NormalizeOptions [Option('a', "assigned-to", Required = false, Default = "me", HelpText = "Filter by assignee. Use 'me' for the current user, or 'any' for all. Defaults to 'me'.")] public string AssignedTo { get; set; } - [Option('p', "parent", Required = false, HelpText = "Restrict to children of a specific parent ID.")] + [Option('P', "parent", Required = false, HelpText = "Restrict to children of a specific parent ID.")] public int? ParentId { get; set; } - [Option('n', "dry-run", Required = false, HelpText = "Preview changes without applying them.")] + [Option("dry-run", Required = false, HelpText = "Preview changes without applying them.")] public bool DryRun { get; set; } - [Option("top", Required = false, Default = 200, HelpText = "Maximum number of tasks to fetch (default: 200).")] + [Option('n', "top", Required = false, Default = 200, HelpText = "Maximum number of tasks to fetch (default: 200).")] public int Top { get; set; } } diff --git a/DevOps/Options/PrListOptions.cs b/DevOps/Options/PrListOptions.cs index 104d58d..6e8ed0e 100644 --- a/DevOps/Options/PrListOptions.cs +++ b/DevOps/Options/PrListOptions.cs @@ -20,6 +20,6 @@ public class PrListOptions [Option('n', "top", Required = false, Default = 25, HelpText = "Maximum number of pull requests to show (default: 25).")] public int Top { get; set; } - [Option('m', "mine", Required = false, HelpText = "Only pull requests created by me.")] + [Option("mine", Required = false, HelpText = "Only pull requests created by me.")] public bool Mine { get; set; } } diff --git a/README.md b/README.md index fddf1e9..676e032 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,13 @@ devops config -o https://dev.azure.com/myorg devops config --login # Option B — Personal Access Token -devops config -o https://dev.azure.com/myorg -p +devops config -o https://dev.azure.com/myorg -P ``` Then the shared settings: ```powershell -devops config -P MyProject # set default project +devops config -p MyProject # set default project devops config -T "MyProject Team" # set default team (for iteration and area resolution) devops config -e your@email.com # set email manually if auto-detection fails devops config --show # display current configuration @@ -62,11 +62,11 @@ When you sign in (`--login`) or provide a `--pat`, the CLI automatically fetches | Option | Alias | Description | |---|---|---| | `--org` | `-o` | Azure DevOps organization URL | -| `--login` | `-l` | Sign in interactively with Microsoft Entra ID | +| `--login` | | Sign in interactively with Microsoft Entra ID | | `--logout` | | Sign out and clear the cached Entra ID token | | `--tenant` | | Entra ID tenant ID or domain to sign in against (defaults to your home tenant) | -| `--pat` | `-p` | Personal Access Token | -| `--project` | `-P` | Default project (used when `--project` is omitted from other commands) | +| `--pat` | `-P` | Personal Access Token | +| `--project` | `-p` | Default project (used when `--project` is omitted from other commands) | | `--team` | `-T` | Default team for resolving the active iteration and area path (defaults to `{Project} Team`) | | `--email` | `-e` | Your email address, used to resolve `--assigned-to me`. Set manually if auto-detection fails | | `--border` | | Table border style for list output: `minimal` (default), `square`, or `markdown` | @@ -78,7 +78,7 @@ When you sign in (`--login`) or provide a `--pat`, the CLI automatically fetches ## Work Item Commands -> **Note on `-p`:** most commands use `-p` as the short alias for `--project`. On `list`, `mine` and `normalize`, `-p` is `--parent` instead (project uses `-P` there), so the more common parent filter gets the short flag. When in doubt, use the long form (`--project` / `--parent`). +> **Note on `-p` / `-P`:** `-p` is always `--project`. The uppercase `-P` is each command's secondary flag: `--parent` on `list`, `mine` and `normalize`; `--priority` on `create` and `update`; `--pat` on `config`. ### `get` — Get work item details @@ -104,16 +104,16 @@ devops mine devops mine -s Active devops mine -t Bug devops mine -s "In Progress" -t Task -devops mine -p 1234 # only children of work item 1234 +devops mine -P 1234 # only children of work item 1234 ``` | Option | Alias | Description | |---|---|---| -| `--project` | `-P` | Project name (uses default if configured) | +| `--project` | `-p` | Project name (uses default if configured) | | `--state` | `-s` | Filter by state | | `--type` | `-t` | Filter by work item type | | `--query` | `-q` | Additional WIQL WHERE clause | -| `--parent` | `-p` | Filter by parent work item ID | +| `--parent` | `-P` | Filter by parent work item ID | | `--top` | `-n` | Maximum number of work items to fetch (default: 50) | | `--output` | `-o` | Output format: `json` or `csv`. Defaults to a table | @@ -125,8 +125,8 @@ devops mine -p 1234 # only children of work item 1234 devops list devops list -s Active devops list -t Bug -a me -devops list -P MyProject -s "In Progress" -t Task -devops list -p 1234 # only children of work item 1234 +devops list -p MyProject -s "In Progress" -t Task +devops list -P 1234 # only children of work item 1234 devops list -n 200 # fetch up to 200 items instead of the default 50 devops list -s Active -o json # machine-readable output for scripting devops list -q "[System.IterationPath] UNDER 'MyProject\\Sprint 1'" @@ -136,12 +136,12 @@ Queries fetch up to `--top` items (default 50). When more match than were fetche | Option | Alias | Description | |---|---|---| -| `--project` | `-P` | Project name (uses default if configured) | +| `--project` | `-p` | Project name (uses default if configured) | | `--state` | `-s` | Filter by state (e.g., `Active`, `Closed`, `Resolved`) | | `--type` | `-t` | Filter by work item type (e.g., `Task`, `Bug`, `User Story`) | | `--assigned-to` | `-a` | Filter by assignee. Use `me` for the current user | | `--query` | `-q` | WIQL WHERE clause for advanced filtering | -| `--parent` | `-p` | Filter by parent work item ID | +| `--parent` | `-P` | Filter by parent work item ID | | `--top` | `-n` | Maximum number of work items to fetch (default: 50) | | `--output` | `-o` | Output format: `json` or `csv`. Defaults to a table | @@ -232,18 +232,18 @@ Renames Tasks whose title follows the `[Role] Description` pattern (e.g., create devops normalize # normalize my tasks devops normalize --dry-run # preview without applying devops normalize -s Active # only tasks in a given state -devops normalize -p 1234 # only children of work item 1234 +devops normalize -P 1234 # only children of work item 1234 devops normalize -a any # all tasks, regardless of assignee ``` | Option | Alias | Description | |---|---|---| -| `--project` | `-P` | Project name (uses default if configured) | +| `--project` | `-p` | Project name (uses default if configured) | | `--state` | `-s` | Filter by state | | `--assigned-to` | `-a` | Filter by assignee. Use `me` (default) or `any` for all | -| `--parent` | `-p` | Restrict to children of a specific parent ID | -| `--dry-run` | `-n` | Preview changes without applying them | -| `--top` | | Maximum number of tasks to fetch (default: 200) | +| `--parent` | `-P` | Restrict to children of a specific parent ID | +| `--dry-run` | | Preview changes without applying them | +| `--top` | `-n` | Maximum number of tasks to fetch (default: 200) | --- @@ -394,7 +394,7 @@ devops pr-list --mine | `--status` | `-s` | `active` (default), `completed`, `abandoned`, or `all` | | `--target` | `-t` | Filter by target branch (e.g., `main`) | | `--top` | `-n` | Maximum number of PRs to show (default: 25) | -| `--mine` | `-m` | Only pull requests you created | +| `--mine` | | Only pull requests you created | --- @@ -540,7 +540,7 @@ Entra sign-in requires the organization policy *"Allow access via Microsoft Entr ### Personal Access Token ```powershell -devops config -o https://dev.azure.com/myorg -p +devops config -o https://dev.azure.com/myorg -P ``` Go to **User Settings → Personal Access Tokens → New Token** and grant the following scopes: