Add command line switch to print dependencies
See original GitHub issueThere are situations, where one is interested only in dependencies for a specific Sass file, e.g., in Makefiles. It would be great, if Sass could provide such a list. For example:
// file foo.scss
@import "bar";
// file _bar.scss
@import "baz";
// file _baz.scss
// ...some Sass...
Then imagine this call and response:
$ sass --print-dependencies foo.scss
_bar.scss
_baz.scss
It would be great to have for auto-generating dependency files for your build tool of choice, e.g. GNU make:
$ echo "foo.scss: $(sass --print-dependencies foo.scss)" > foo.scss.mk
Issue Analytics
- State:
- Created 10 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
dependency-check-cli – Command Line Arguments
Print the version information. Optional. --cveValidForHours, <hours>, The number of hours to wait before checking for new updates from the NVD. The default...
Read more >Command Line Options and Return Values
Profiling option: Simulate ShellExecute by inserting any App Paths directories into the PATH environment variable - Use /ps:0 to start Dependency Walker with ......
Read more >Devenv command line switches - Visual Studio - Microsoft Learn
Devenv lets you set various options for the IDE, build projects, debug projects, and deploy projects from the command line. Use these switches...
Read more >How to add command line parameter dependency using ...
I am using JCommander for command line parameters parsing. I would like to add parameter dependency, but from the JCommander documentation, I am...
Read more >Using Command-Line Arguments to Configure In-App ...
Using Command-Line Arguments to Configure In-App Dependencies ... CommandLine.arguments[valueIndex] print(greeting) } } else { print("Hello, world!") }.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As demonstrated, it is an aspect of integrating with a build tool for compiling sass files.
gcc
provides this ability via the-M
command line option. From the man page for gcc, the-M
option: “Instead of outputting the result of preprocessing, output a rule suitable for make describing the dependencies of the main source file.”Newline separated lists is a very machine readable format designed for use with numerous unix utilities. For example:
sass --dependencies foo.scss | xargs vim
and now I’ve opened every dependency of my file in my text editor. It also works great with grep.That’s not a fair go at it. It doesn’t take import paths into account. It doesn’t take relative imports into account. Doing these things correctly is non-trivial.
The claim is that listing dependencies is a form of tool integration. A code example was provided by @codifferous showing this to be true. Simply stating that the purview of sass is one form of tool integration but not another is not founded in a rational basis. You have made a value judgement that one tool is more important to integrate with than another and that the first one is worth working on and the second one is not.
This is really the core of your argument. You simply don’t think it’s worth supporting
make
out of the box. I disagree. Make continues to be an important build tool and I don’t find the cost of having this option in the-h
output onerous. But, to be fair, GCC doesn’t list the-M
option in the--help
output, it only mentions it in the man page.Every option should be evaluated independently. I’ve certainly rejected many of them. No one has claimed that every option should be added, and using a slippery-slope argument is not productive.
This is not planned.