Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List command output should feed the TodoItem object to pipeline #10

Open
mehmetseckin opened this issue Nov 15, 2019 · 4 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@mehmetseckin
Copy link
Owner

This would allow scripting support, e.g.

todo list | ForEach-Item { todo complete --item-id $_.Id }
@mehmetseckin mehmetseckin self-assigned this Nov 15, 2019
@mehmetseckin mehmetseckin added the enhancement New feature or request label Nov 15, 2019
@mehmetseckin mehmetseckin added this to the Scripting Support milestone Nov 24, 2019
@Regenhardt
Copy link
Contributor

It actually does, I filter items like todo list Shopping | grep Cheese. I guess using --no-status also makes it easier to process further.

@mehmetseckin
Copy link
Owner Author

It actually does, I filter items like todo list Shopping | grep Cheese. I guess using --no-status also makes it easier to process further.

That's pretty cool! I think it would still be somewhat difficult to script without the unique ID of the to-do item as the Render() method uses Console.Write or Console.WriteLine APIs.

This issue is about making the TodoItem object itself available as a pipeline object in the output stream, however, I'm not sure if there's an equivalent of that for non-PowerShell environments. Alternatively we could add some query parameters to format the output of the list command, so desired properties can be listed, with a view to enhance this onto an output-formatting facility where we could enable csv/tsv outputs. 🥘 4️⃣ 💭

@Regenhardt
Copy link
Contributor

I can definitely see something like --out [csv|json|powershell]. Just have no idea how to format the output for powershell to accept it as objects. Everything else seems simple enough.

@mehmetseckin
Copy link
Owner Author

I haven't done any research but I'm guessing we could cast a TodoItem to a PSObject (or implement that interface in a wrapper object, turn it into a byte array and put it in the output stream). PowerShell tends to get along with .NET objects quite well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants