clispark 1.20.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clispark",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Interactive scaffolding tool for new CLI projects",
5
5
  "keywords": [
6
6
  "cli",
@@ -0,0 +1,10 @@
1
+ function Complete-Task {
2
+ [CmdletBinding()]
3
+ param(
4
+ [Parameter(Mandatory, Position = 0)]
5
+ [int]$Id
6
+ )
7
+ process {
8
+ Write-Output "Completed task $Id"
9
+ }
10
+ }
@@ -0,0 +1,17 @@
1
+ function Get-Task {
2
+ [CmdletBinding()]
3
+ param(
4
+ [Parameter(Position = 0)]
5
+ [string]$Filter,
6
+
7
+ [switch]$Done
8
+ )
9
+ process {
10
+ $base = if ($Filter) { "Listing tasks matching `"$Filter`"" } else { 'Listing all tasks' }
11
+ if ($Done) {
12
+ Write-Output "$base (completed only: true)"
13
+ } else {
14
+ Write-Output $base
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ function New-Task {
2
+ [CmdletBinding()]
3
+ param(
4
+ [Parameter(Mandatory, Position = 0)]
5
+ [string]$Title,
6
+
7
+ [ValidateSet('Low', 'Medium', 'High')]
8
+ [string]$Priority
9
+ )
10
+ process {
11
+ if ($Priority) {
12
+ Write-Output "Created task: `"$Title`" (priority: $Priority)"
13
+ } else {
14
+ Write-Output "Created task: `"$Title`""
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ Describe 'Complete-Task' {
2
+ It 'marks a task as complete' {
3
+ Complete-Task -Id 1 | Should -Be 'Completed task 1'
4
+ }
5
+ }
@@ -0,0 +1,13 @@
1
+ Describe 'Get-Task' {
2
+ It 'lists all tasks by default' {
3
+ Get-Task | Should -Be 'Listing all tasks'
4
+ }
5
+
6
+ It 'lists tasks matching a filter' {
7
+ Get-Task -Filter 'groceries' | Should -Be 'Listing tasks matching "groceries"'
8
+ }
9
+
10
+ It 'lists tasks matching a filter, showing only completed ones' {
11
+ Get-Task -Filter 'groceries' -Done | Should -Be 'Listing tasks matching "groceries" (completed only: true)'
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ Describe 'New-Task' {
2
+ It 'creates a task with just a title' {
3
+ New-Task -Title 'Buy milk' | Should -Be 'Created task: "Buy milk"'
4
+ }
5
+
6
+ It 'creates a task with an optional priority' {
7
+ New-Task -Title 'Buy milk' -Priority 'High' | Should -Be 'Created task: "Buy milk" (priority: High)'
8
+ }
9
+ }