1.0.3 • Published 1 year ago

nv-cli-forsw v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

nv-cli-forsw

  • cli-tool
  • creat a for(...) { switch ...} structure

install

  • npm install nv-cli-forsw -g

usage

        Usage: nv_cli_forsw [options] 
        Options:
            -t, --to            to
            -s, --step          step incr
            -f, --from          from default 0
            -i, --indent        default 1
            -h, --help          usage

example

        nv-cli-forsw# nv_cli_forsw -t 13 -s 4

            for(let i=0;i<13;i=i+4) {
                let match = i & 0b111;
                switch(match) {
                    case(0) : {

                        /*...handle code...*/
                        break;
                    }
                    case(1) : {

                        /*...handle code...*/
                        break;
                    }
                    case(2) : {

                        /*...handle code...*/
                        break;
                    }
                    default/*(3)*/: {

                        /*...handle code...*/
                        break;
                    }
                }
            }

LICENSE

  • ISC