Skip to content

Add new flag 'shell' which outputs shell commands from a task#1135

Closed
the-kaustubh wants to merge 3 commits into
go-task:mainfrom
the-kaustubh:issue-701
Closed

Add new flag 'shell' which outputs shell commands from a task#1135
the-kaustubh wants to merge 3 commits into
go-task:mainfrom
the-kaustubh:issue-701

Conversation

@the-kaustubh

Copy link
Copy Markdown

The PR adds new flag --shell to the task command which works similar to dry run flag. It outputs raw shell command corresponding to the task without executing it.

Commit 2231021 also adds the same functionality to the pre-condition checks.

This PR addresses #701 Linting of commands

@q0rban

q0rban commented Jun 17, 2024

Copy link
Copy Markdown

For the purposes of passing to another linter, such as shellcheck, would this need to do some preprocessing of template variables?

@trulede

trulede commented May 11, 2025

Copy link
Copy Markdown
Contributor

It might be interesting to combine this with #2114 as a trace implementation. For instance:

task default --tracer=audit

where the "audit" prints resolved task variables, envars (send to sh) and the sh commands.

@trulede trulede self-assigned this Apr 19, 2026
@trulede

trulede commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

I think here a neater approach would be to modify the existing --dry flag to allow optional values, such as --dry=cmds.

See #2395

@trulede

trulede commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Actually, this is working via the dry command.

@trulede trulede closed this Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants