Code Monkey home page Code Monkey logo

xo's Issues

Add some help

Imagine I downloaded this app once, then forgot about it, then rediscovered on disk.
Obvious questions are: what it does, is it safe (any dry-run switch), how fresh it is, where to get updates…

$ xo.exe & xo.exe --version & xo.exe --help

Usage: xo '/<pattern>/<formatter>/[flags]'

panic: runtime error: invalid memory address or nil pointer dereference    
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x4010f5]                         
                                                                           
goroutine 1 [running]:                                                     
main.main()                                                                
        /Users/EzekielGabrielse/Go/src/github.com/ezekg/xo/main.go:24 +0xb5

panic: runtime error: invalid memory address or nil pointer dereference    
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x4010f5]                         
                                                                           
goroutine 1 [running]:                                                     
main.main()                                                                
        /Users/EzekielGabrielse/Go/src/github.com/ezekg/xo/main.go:24 +0xb5

Fallback values used in a formatter without spaces do not work as expected

For example,

cat /etc/apache2/sites-available/*.conf | xo '/\*:443.*?ServerName\s(www\.)?([-.0-9A-Za-z]+)/$1:?www.$2/mis'

stops on the . after www, so sites that contain www. in the name are output as www..site-name.com. To fix this, we should introduce optionally wrapping fallback values within parenthesis, as well as support for escaping those parenthesis in the case that they are actually needed in the formatter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.