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

CLI options: debug info & sourcemap #42

Closed
emagnier opened this issue Dec 19, 2013 · 8 comments
Closed

CLI options: debug info & sourcemap #42

emagnier opened this issue Dec 19, 2013 · 8 comments

Comments

@emagnier
Copy link

If I remember well, the previous flag -g was for the Debug-Info. Is this feature is still available in Sassc? Because it's now mapped to the sourcemap option.

I'm thinking that it should be better for users (and on the Sass porting in general) to keep a closer CLI from the Ruby-Sass version. So the new Sourcemap option should be available via the --sourcemap flag.

In the past there was some confusions between debug-info, sourcemap and source-comments (which are all different things). A more clear CLI and documentation (via the -h) should help users (and Libsass/Sassc contributors) to be less confused. So the new -g should be definitely another letter (because it correspond to debug-info in Ruby-Sass).

@emagnier
Copy link
Author

FYI I found the implementation of the line-number and the debug-info options here: sass/libsass@4d44a4d with also some bad namings in the code.

@cbmd
Copy link

cbmd commented Dec 24, 2013

What i'm doing wrong with sourcemaps?
I'm using -g options and result returned equals to result that returned from compilation without options? And not creating sourcemaps file in directory
eg.:
sassc -g styles.scss > styles.css equals to sassc styles.scss > styles.css

Thank you in advice!

@ghost
Copy link

ghost commented Dec 24, 2013

@cbmd Source map generation currently only works if you specify an output file with the -o flag. sassc -g -o styles.css styles.scss should generate a source map. If you do not specifiy an output path, setting the sourceMappingURL directive does not make much sense, as it is relative to the output path.

@emagnier As the -g options was already documented as source map flag, I've coupled the source map implementation to it. But I agree we should review the API and keep it as close as possible to the Ruby version.

@emagnier
Copy link
Author

emagnier commented Jan 3, 2014

@svnieuw: Thanks a lot for your PR, it's much clearer now :-)

Also I played a bit with the latest version and found some minor issues (tested only on Windows):

  • The -l doesn't seem to work: I get option '-l' is ambiguous. However --line-numbers and --line-comments are working fine.
  • Long arguments are also working with a simple dash, like -help. I don't think they should.

@ghost
Copy link

ghost commented Jan 3, 2014

I could replace the getopt_long_only() call with getopt_long(). This will reject single dash long options, but -help would still print the help message. It even did before my change because only the first character is parsed, the help message is printed and the program exits.

The -l flag seems to work fine for me on OS X and Linux. Which compiler did you use to compile sassc on Windows?

@emagnier
Copy link
Author

emagnier commented Jan 3, 2014

I used MsysGit to compile on Windows, but I will redo some tests probably tonight.

@ghost
Copy link

ghost commented Jan 3, 2014

I was able to reproduce the issue in a Windows VM with MsysGit. I will try to fix it this weekend.

@emagnier
Copy link
Author

emagnier commented Jan 4, 2014

Thanks for the latest PR, everything looks good now!

@emagnier emagnier closed this as completed Jan 4, 2014
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

No branches or pull requests

2 participants