From a8b6ed6e377984575299421c9a0dad0603e35b69 Mon Sep 17 00:00:00 2001 From: Jonas Lima de Amorim Date: Tue, 28 Jul 2026 16:54:48 -0300 Subject: [PATCH 1/3] feat(cli)!: make -p always --project; -P is each command's secondary flag Equalizes the project short flag across all commands. Previously -p was --project in most commands but --parent in list/mine/normalize (project was -P there) and --pat in config. Now -p is always --project, and -P is the per-command secondary: --parent (list/mine/normalize), --priority (create/update), --pat (config). BREAKING: scripts using -p/-P on list, mine, normalize or config change meaning. --- DevOps/Options/ConfigOptions.cs | 4 ++-- DevOps/Options/ListOptions.cs | 4 ++-- DevOps/Options/MineOptions.cs | 4 ++-- DevOps/Options/NormalizeOptions.cs | 4 ++-- README.md | 32 +++++++++++++++--------------- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/DevOps/Options/ConfigOptions.cs b/DevOps/Options/ConfigOptions.cs index 7b0396a..4d8a506 100644 --- a/DevOps/Options/ConfigOptions.cs +++ b/DevOps/Options/ConfigOptions.cs @@ -8,7 +8,7 @@ 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).")] @@ -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..d1330dc 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,7 +14,7 @@ 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.")] diff --git a/README.md b/README.md index fddf1e9..c6050a7 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 @@ -65,8 +65,8 @@ When you sign in (`--login`) or provide a `--pat`, the CLI automatically fetches | `--login` | `-l` | 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,16 +232,16 @@ 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 | +| `--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) | @@ -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: From a5ba579e1b85240f7085dde683645cf66bea721f Mon Sep 17 00:00:00 2001 From: Jonas Lima de Amorim Date: Tue, 28 Jul 2026 17:24:26 -0300 Subject: [PATCH 2/3] feat(cli)!: normalize --dry-run is long-only; -n now maps to --top Frees the short alias held by a boolean so the value-taking --top gets it, matching --top -n on list/mine/runs. BREAKING: 'normalize -n' now means --top instead of --dry-run. --- DevOps/Options/NormalizeOptions.cs | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DevOps/Options/NormalizeOptions.cs b/DevOps/Options/NormalizeOptions.cs index d1330dc..705df0e 100644 --- a/DevOps/Options/NormalizeOptions.cs +++ b/DevOps/Options/NormalizeOptions.cs @@ -17,9 +17,9 @@ public class NormalizeOptions [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/README.md b/README.md index c6050a7..0d7c0f0 100644 --- a/README.md +++ b/README.md @@ -242,8 +242,8 @@ devops normalize -a any # all tasks, regardless of assignee | `--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) | +| `--dry-run` | | Preview changes without applying them | +| `--top` | `-n` | Maximum number of tasks to fetch (default: 200) | --- From 723411f8f3ed44492397e5f6a67cc74c93f27c52 Mon Sep 17 00:00:00 2001 From: Jonas Lima de Amorim Date: Tue, 28 Jul 2026 17:26:42 -0300 Subject: [PATCH 3/3] feat(cli)!: make --login and --mine long-only (booleans yield their short) Applies the rule that short aliases are reserved for value-taking parameters. BREAKING: 'config -l' and 'pr-list -m' are no longer recognized; use --login / --mine. --- DevOps/Options/ConfigOptions.cs | 2 +- DevOps/Options/PrListOptions.cs | 2 +- README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DevOps/Options/ConfigOptions.cs b/DevOps/Options/ConfigOptions.cs index 4d8a506..56ae30c 100644 --- a/DevOps/Options/ConfigOptions.cs +++ b/DevOps/Options/ConfigOptions.cs @@ -11,7 +11,7 @@ public class ConfigOptions [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.")] 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 0d7c0f0..676e032 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ 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 | @@ -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 | ---